long long query(int rt,int p) { long long res=0; while(top[p]!=1){res+=getsum(rt,dfo[top[p]],dfo[p],1,n);p=fa[top[p]];} res+=getsum(rt,1,dfo[p],1,n); return res; }
int work(const int caseindex,FILE* in,FILE* out) { // 最佳顺序为每盒火柴均按单调顺序排列 // 其实只要在一盒火柴中完成交换操作即可,另一盒保持不动 // 求逆序对可得交换次数 int n,i; fscanf(in,"%d",&n); for (i=1;i<=n;i++) { fscanf(in,"%d",&a[i].val); a[i].id=i; } for (i=1;i<=n;i++) { fscanf(in,"%d",&b[i].val); b[i].id=i; } qsort(&a[1],n,sizeof(struct match),cmp); qsort(&b[1],n,sizeof(struct match),cmp); for (i=1;i<=n;i++) c[a[i].id]=b[i].id; // 树状数组求逆序对 m=n; memset(t,0,sizeof(t)); long long ans=0; for (i=1;i<=n;i++) { int x=c[i]; ans+=getsum(n)-getsum(x); ans%=99999997; add(x,1); } fprintf(out,"%lld\n",ans); return 0; }
int main() { while(scanf("%d %d\n",&n,&k)!=EOF) { memset(c,0,sizeof(c)); int m,maxi=0; for (;p[maxi+1]<=n;maxi++); m=p[maxi]; for(int i=1;i<=n;++i) scanf("%s %d\n",name[i],&a[i]); for (int i=1;i<=n;i++) c[i]=i & -i; for(int i=1;i<m;++i) { int left=1,right=n,next; if(a[k]>0) next=(a[k]%(n-i)+getsum(k)%(n-i)-1)%(n-i); else next=(a[k]%(n-i)+getsum(k)%(n-i))%(n-i); if(next<=0) next+=n-i; add(k,-1); while(left<=right) { int mid=left+right>>1; if(getsum(mid)<next) left=mid+1; else right=mid-1; } k=left; } printf("%s %d\n",name[k],pnum[maxi]); } return 0; }
long long getsum(int p,int gl,int gr,int ll,int rr) { long long res=(esum[gr]-esum[gl-1])*ct[p]; if(gl==ll && gr==rr) return sum[p]+res; int mid=(ll+rr)/2; if(gr<=mid) return res+getsum(ls[p],gl,gr,ll,mid); else if(gl>mid)return res+getsum(rs[p],gl,gr,mid+1,rr); else return res+getsum(ls[p],gl,mid,ll,mid) + getsum(rs[p],mid+1,gr,mid+1,rr); }
int main(){ scanf("%d",&k); rep(i,k)scanf("%lld",&B[i]); rep(i,k)scanf("%lld",&C[i]); scanf("%lld%lld%lld",&m,&n,&p); for(int i=1;i<=k;i++)sum[i]=(sum[i-1]+B[i-1])%p; ans=getsum(n)-getsum(m-1); while(ans<0)ans+=p; return printf("%lld",ans),0; }
int getsum(int ll,int rr,int l,int r,int n) { int mid; if (ll>rr) return 0; if (ll==l&&rr==r) return tree[n]; mid=(l+r)/2; if (rr<=mid) return getsum(ll,rr,l,mid,n*2); else if (ll>mid) return getsum(ll,rr,mid+1,r,n*2+1); else return (getsum(ll,mid,l,mid,n*2)+getsum(mid+1,rr,mid+1,r,n*2+1)); }
int getsum(Node *root, int level){ int div = (int)pow(4.0, level); if(root->type == 'e') return 0; else if(root->type == 'f') return 1024 / div; else{ return getsum(root->c0, level+1)+getsum(root->c1, level+1) +getsum(root->c2, level+1)+getsum(root->c3, level+1); } }
void work() { for(int i=1;i<=n;++i) { int co=getsum(c1,x[i]),num=getsum(c2,x[i]),tot=getsum(c1,MAXN); ans+=v[i]*(x[i]*num-co+tot-co-x[i]*(i-1-num)); add(c1,x[i],x[i]); add(c2,x[i],1); } printf("%d\n",ans); }
void init() { int i , ins , sx , sy , ans , del , tmp , k; //memset( idt , 0 , sizeof( idt ) ); //memset( a , 0 , sizeof( a ) ); //cin>>n>>m>>wide; scanf( "%d%d%d" , &n , &m , &wide ); for( i = 1 ; i <= n ; ++ i ) idt[ i ] = 0; for( i = 1 ; i <= n ; ++ i ) { scanf( "%d" , &a[ i ] ); bit_update( i , a[ i ] ); } for( i = 1 ; i <= m ; ++ i ) { scanf( "%d%d%d" , &ins , &sx , &sy ); //cin>>ins>>sx>>sy; if( not ins ) { bit_update( sx , sy - a[ sx ] ); a[ sx ] = sy; } else if( ins == 1 ) { bit_update( sx , a[ sy ] - a[ sx ] ); bit_update( sy , a[ sx ] - a[ sy ] ); tmp = a[ sx ]; a[ sx ] = a[ sy ]; a[ sy ] = a[ sx ]; } else { ans = -INF; for( k = sy - wide + 1 ; k >= sx ; -- k ) { del = getsum( k + wide - 1 ) - getsum( k - 1 ); ans = ans > del ? ans : del; } printf( "%d\n" , ans ); //cout<<ans<<"\n"; } } return ; }
int main() { printf("%d + %d = %d\n", 4, 3, add(4,3)); printf("%d - %d = %d\n", 4, 3, sub(4,3)); printf("sum 1 to %d = %d\n",100, getsum(100)); return 0; }
int main(int argc, char* argv[]){ int group; char buff[LEN]; size_t len; Node *root1, *root2; #ifndef ONLINE_JUDGE freopen("297.in", "r", stdin); #endif scanf("%d\n", &group); while(group-- >0){ /* 1. Get tree one */ fgets(buff, LEN, stdin); len = strlen(buff); if(buff[len-1] == '\n'){ buff[len-1] = '\0'; len--; } root1 = build_tree(buff); /* 2. Get tree two */ fgets(buff, LEN, stdin); len = strlen(buff); if(buff[len-1] == '\n'){ buff[len-1] = '\0'; len -- ; } root2 = build_tree(buff); /* combine two trees */ root1 = combine(&root1, &root2); printf("There are %d black pixels.\n", getsum(root1, 0)); /*freetree(root1); freetree(root2);*/ } return 0; }
int main() { int n, q, s; while (~scanf("%d%d%d", &n, &q, &s)) { init(n); while (q--) { int a, b; int op; scanf("%d", &op); if (op == 0) { scanf("%d", &a); printf("%d\n", getsum(a, s, 1, n)); s = a; } else { scanf("%d%d", &a, &b); if (dep[uu[a]] < dep[vv[a]]) { a = w[vv[a]]; } else { a = w[uu[a]]; } update(a, b, 1, n); } } } return 0; }
int main() { int n,m,x; int i; int x1,x2,x3,y1,y2,y3,z1,z2,z3; while(scanf("%d%d",&n,&m)!=EOF){ initial(); for(i=1;i<=m;i++){ scanf("%d",&x); if(x==1){//先从最右下角的开始做,下改上恢复,然后消除队友左边空间的影响(下改上恢复),然后消除后方空间的影响(下改上恢复),最后消除中间空间的影响 scanf("%d%d%d%d%d%d",&x1,&y1,&z1,&x2,&y2,&z2); update(x1,y1,z1); update(x1,y1,z2+1); update(x1,y2+1,z1); update(x1,y2+1,z2+1); update(x2+1,y1,z1); update(x2+1,y1,z2+1); update(x2+1,y2+1,z1); update(x2+1,y2+1,z2+1); } if(x==0){ scanf("%d%d%d",&x3,&y3,&z3); printf("%d\n",getsum(x3,y3,z3)&1);//等价于getsum(x)mod2 } } } return 0; }
int main() { freopen("in.txt", "r", stdin); int T; scanf("%d", &T); for (int ica = 1; ica <= T; ++ica) { printf("Case #%d:\n", ica); scanf("%d", &n); for (int i = 0; i < n; ++i) { scanf("%d", &a[i]); p[i] = i; if (a[i] == 1) p[i] = i + 1; sum[i] = a[i]; } p[n] = n; p[n + 1] = n + 1; int k; scanf("%d", &k); for (int i = 0; i < k; ++i) { int q, l, r; scanf("%d%d%d", &q, &l, &r); if (!q) { int x = l; while ((x=get(x)) <= r) { int t = a[x] * a[x]; if (t >= 1000) { t = 1000; p[x] = x + 1; } if (t != a[x]) { a[x] = t; add(x, t - a[x]); } x = x + 1; } } else { printf("%d\n", getsum(r) - getsum(l) + a[l]); } } } return 0; }
int main(){ int i; ll ans; while(~scanf("%d",&n)){ ans=0,Mem0(c); for(i=1;i<=n;++i){ scanf("%d",a+i); update(a[i]+1); l[i]=getsum(a[i]); } Mem0(c); for(i=n;i;--i){ update(a[i]+1); r[i]=getsum(a[i]); ans+=l[i]*r[i]; } printf("%lld\n",ans); } }
int main() { int i,a,b; while(scanf("%d",&t)!=EOF&&t){ for(i=1;i<=t;i++){ c[i]=0; } for(i=1;i<=t;i++){ scanf("%d%d",&a,&b); update(a,1); update(b+1,-1); } printf("%d",getsum(1)); for(i=2;i<=t;++i) printf(" %d",getsum(i)); printf("\n"); } return 0; }
// 不考虑玩家,单独计算最后一个落子的获得的得分 int Chess_private::estimate() { int sum = 0; for (int i = 0; i < 4; ++i) { int q = 0; int j = 1; int k = 0; int p = 0; j += getsum(i); if (is_have_space) ++q; j += getsum(i, -1); if (is_have_space) ++q; k += getsumf(i); if (is_have_space) ++p; k += getsumf(i, -1); if (is_have_space) ++p; if (j >= 5) return MAX_INT; if (q > 0) sum += qb[j-1][q-1]; if (p > 0) sum += qb[k-1][p-1]*6; } return sum; }
int main(){ int sum,none; int x1,y1,x2,y2,val; memset(tree,0,sizeof(tree)); scanf("%d%d",&none,&n); while(scanf("%d",&none)&&none!=3){ switch(none){ case 1: scanf("%d%d%d",&x1,&y1,&val); x1++,y1++; update(x1,y1,val); break; case 2: scanf("%d%d%d%d",&x1,&y1,&x2,&y2); x1++,y1++,x2++,y2++; sum=getsum(x2,y2)-getsum(x1-1,y2)-getsum(x2,y1-1)+getsum(x1-1,y1-1); printf("%d\n",sum); break; } } return 0; }
void getsum(long long c, long long p ,long long v ) { if(p <= tree[c].left && v >= tree[c].right) { tsum += tree[c].num; return; } if(tree[c].cover != 0 ) { tree[L(c)].cover = tree[c].cover; tree[L(c)].num += (tree[L(c)].right - tree[L(c)].left +1) * tree[L(c)].cover; tree[R(c)].cover = tree[c].cover; tree[R(c)].num += (tree[R(c)].right - tree[R(c)].left + 1)* tree[R(c)].cover ; tree[c].cover = 0 ; } if(v <= tree[c].mid) getsum(L(c),p,v); else if(p > tree[c].mid) getsum(R(c),p,v); else { getsum(L(c),p,tree[c].mid); getsum(R(c),tree[c].mid +1 ,v ); } }
void solve() { int i,sum=0; memset(tree,0,sizeof(tree)); for (i=n;i>=1;i--) { sum+=getsum(1,a[i]-1,1,n,1); modify(a[i],1,n,1); } ans=sum; for (i=1;i<n;i++) { sum+=n-a[i]-a[i]+1; ans=min(ans,sum); } }
int main() { scanf("%d",&t); for(int times=1;times<=t;++times){ scanf("%d%d%d",&n,&m,&k); memset(c,0,sizeof(c)); ans=0; for(int i=1;i<=k;++i) scanf("%d%d",&a[i].x,&a[i].y); qsort(a+1,k,sizeof(a[0]),cmp); for(int i=1;i<=k;++i){ ans+=getsum(a[i].y); add(a[i].y,1); } printf("Test case %d: %I64d\n",times,ans); } }
int main() { int i,j,n,x,sum; while(scanf("%d",&n)==1) { sum=0; memset(a,0,sizeof(a)); for(i=1;i<=n;i++) { scanf("%d",&x); sum=sum+(i-1-getsum(x)); add(x); } printf("%d\n",sum); } return 0; }
int main() { scanf("%d%d%s",&n,&k,str); c1[k-1]=c2[k]=1; for(int i=k;i<MAXN;i++) c1[i]=((c1[i-1]*i)%MASK*mul_inv(i-k+1))%MASK; for(int i=k+1;i<MAXN;i++) c2[i]=((c2[i-1]*i)%MASK*mul_inv(i-k))%MASK; // for(int i=0;i<100;i++) printf("%lld ",c2[i]); // printf("\n"); sum[0]=str[0]-'0'; for(int i=1;i<n;i++) sum[i]=sum[i-1]+str[i]-'0'; long long off=1; for(int i=0;i<n;i++) { ans=(ans+(((getsum(n-i-2)*c1[n-i-2])%MASK+((str[n-i-1]-'0')*c2[n-i-1])%MASK)*off)%MASK)%MASK; off=(off*10)%MASK; } printf("%I64d\n",ans); return 0; }
int main() { int t; // freopen("/home/plac/problem/input.txt","r",stdin); scanf("%d",&t); // freopen("/home/plac/problem/output.txt","w",stdout); for(int CASE = 1; CASE <= t; CASE ++){ int n ; scanf("%d",&n); scanf("%s",str); build(1,0,n-1); int q; scanf("%d",&q); printf("Case %d:\n",CASE); while(q--) { int a, b ; char t1[10],t2[2]; scanf("%s %d %d",t1,&a,&b); if(t1[0] == 'r'){ fan(1,a,b); }else if(t1[0] == 'q'){ tsum = 0 ; ok = 1; getsum(1,a,b); if(ok == 1 && tsum == 0 && (b-a+1)%2 == 0) printf("YES\n"); else printf("NO\n"); }else{ scanf("%s",t2); if(t2[0] == '(') update(1,a,b,1); else update(1,a,b,-1); } } printf("\n"); } return 0 ; }
int main() { long long n ,m; while(scanf("%lld %lld",&n,&m) != EOF) { for (long long i = 1;i <= n;i ++) scanf("%lld",&a[i]); build(1,1,n); char str[10]; for(long long i =1 ;i <= m;i ++) { long long a, b ,c; scanf("%s",str); if(str[0] == 'Q') { scanf("%lld %lld",&a,&b); if(a >b ) { long long temp = a ; a = b ; b = temp ; } tsum = 0 ; getsum(1,a,b); printf("%lld\n",tsum); } else { scanf("%lld %lld %lld",&a,&b,&c); if(a > b ) { long long temp = a; a = b; b = temp; } update(1,a,b,c); } } } return 0 ; }
int main() { #ifndef ONLINE_JUDGE freopen("in.txt", "r",stdin); #endif scanf("%d",&n); m=MAXN; for(int i=0;i<n;i++) { int x,y; scanf("%d %d",&x,&y); x++; level[getsum(x)]++; plus(x); } for(int i=0;i<n;i++) printf("%d\n",level[i]); return 0; }
void getsum(int c, int p, int v ){ if(ok == 0 ) return; if(p <= tree[c].l && v >= tree[c].r){ if(tree[c].c != 0){ tsum += tree[c].sum ; if(tsum < 0 ) ok = 0 ; return; }else { Pushdown(c); getsum(L(c),p,tree[c].m); getsum(R(c),tree[c].m+1,v); return; } } Pushdown(c); if(v <= tree[c].m) getsum(L(c),p,v); else if(p > tree[c].m) getsum(R(c),p,v); else { getsum(L(c),p,tree[c].m); getsum(R(c),tree[c].m+1,v); } }
Float evaluate_sequences(vector<vector<int> > &goldS, vector<vector<int> > &predicted, vector<string> &LIS , int num_labels, int verbose, ofstream &out){ int numtag,numctag,numbtag; numtag=numctag=numbtag=0; int num_class = ( num_labels / 2 ) + 1; vector<int> ccount(num_class,0),pcount(num_class,0),ncorrect(num_class,0), nleft(num_class,0),nright(num_class,0), nbcorrect(num_class,0),nbleft(num_class,0),nbright(num_class,0); int match,bmatch; match=bmatch=0; int num_seq = goldS.size(); for (int i = 0; i < num_seq ; ++i){ // For each sequence unsigned int N = goldS[i].size(); if ( N != predicted[i].size() ) { cerr << "Unmatching length of labels for sentence" << i << "\n"; abort(); } for ( unsigned int n = 0 ; n < N ; ++n, ++numtag ) { int clabel = goldS[i][n]; int cclass = class_type( clabel ); int cbraket = braket_type( n, goldS[i] ); if ( cbraket == SBrac || cbraket == BBrac ) { ccount[cclass]++; } int plabel = predicted[i][n]; int pclass = class_type( plabel ); int pbraket = braket_type( n, predicted[i] ); if ( pbraket == SBrac || pbraket == BBrac ) { pcount[pclass]++; } if ( cbraket == pbraket ) numbtag++; if ( clabel == plabel && cbraket == pbraket ) numctag++; if ( pbraket == SBrac && cbraket == SBrac ) { nbcorrect[pclass]++; nbleft[pclass]++; nbright[pclass]++; if( pclass == cclass ) { ncorrect[pclass]++; nleft[pclass]++; nright[pclass]++; } } else if ( pbraket == SBrac && cbraket == EBrac ) { nbright[pclass]++; if( pclass == cclass ) { nright[pclass]++; } } else if ( pbraket == SBrac && cbraket == BBrac ) { nbleft[pclass]++; if( pclass == cclass ) { nleft[pclass]++; } } else if ( pbraket == BBrac && cbraket == SBrac ) { nbleft[pclass]++; if( pclass == cclass ) { nleft[pclass]++; } } else if ( pbraket == BBrac && cbraket == BBrac ) { nbleft[pclass]++; bmatch=1; if( pclass == cclass ) { nleft[pclass]++; match=1;} } /* if ( pbraket != cbraket ) bmatch = 0; if (!(clabel == plabel && cbraket == pbraket ) ) match = 0; if ( pbraket == none || cbraket == none ) match=bmatch=0; */ if ( pbraket != cbraket || pbraket == none ) bmatch = 0; if ( cclass != pclass || !bmatch ) match = 0; if ( pbraket == EBrac && cbraket == SBrac ) { nbright[pclass]++; if( pclass == cclass ) { nright[pclass]++; } } if ( pbraket == EBrac && cbraket == EBrac ) { if( bmatch ) nbcorrect[pclass]++; nbright[pclass]++; if( pclass == cclass ) { if ( match && ncorrect[pclass] <= pcount[pclass]) ncorrect[pclass]++; nright[pclass]++; } } } } Float score; int numans = getsum( pcount ); int numref = getsum( ccount ); if (verbose) { out << "\n[Tagging Performance]\n"; out << "# of tags: " << numtag << ",\t correct tags: " << numctag << ",\t correct IOBs: " << numbtag << "\n"; out << "precision with class info: " << (float)numctag/numtag; out << ",\t w/o class info: " << (float)numbtag/numtag << "\n"; out << "\n[Object Identification Performance]\n"; out << "# of OBJECTs: " << numref << "\t ANSWERs: " << numans << ".\n"; out << "\n# (recall / precision / f-score) of ...\n"; } if ( !numref ) cerr << "\n\nNo names in reference!\n"; if ( !numans ) cerr << "\n\nNo names in answers!\n"; Float ret_val = compute_score( getsum(ncorrect), numans, numref , "FULLY CORRECT answer", verbose, out); /* There is a bug on the right score = compute_score( getsum(nleft), numans, numref , "correct LEFT boundary", verbose, out ); score = compute_score( getsum(nright), numans, numref , "correct RIGHT boundary", verbose, out ); */ if (num_class > 2 && verbose ) for( unsigned int cl = 1 ; cl < pcount.size() ; ++cl ) { string cl_str = LIS[reverse_class_type(cl)]; out << "\n[" << cl << "/" << string(cl_str,2,int(cl_str.size()-2)) << "\tIdentification Performance]\n"; out << "# of OBJECTs: " << ccount[cl] << ",\t ANSWERs: " << pcount[cl]; out << "\n# (recall / precision / f-score) of ...\n"; score = compute_score( ncorrect[cl], pcount[cl], ccount[cl] , "FULLY CORRECT answer", verbose, out ); /* score = compute_score( nleft[cl], pcount[cl], ccount[cl] , "correct LEFT boundary", verbose, out ); score = compute_score( nright[cl], pcount[cl], ccount[cl] , "correct RIGHT boundary", verbose, out ); */ } else if ( !verbose ) for( unsigned int cl = 1 ; cl < pcount.size() ; ++cl ) { score = compute_score( ncorrect[cl], pcount[cl], ccount[cl] , "FULLY CORRECT answer", verbose, out ); cerr << "Cl:" << cl << " " << score << " "; } //assert(ret_val<=1.0); if (ret_val>1.0) ret_val=1.0; return ret_val; }
Float evaluate_sequences(vector<vector<int> > &goldS,vector<vector<int> > &predicted,vector<string> &LIS ,int num_labels,vector<verbose_res> &VR){ int numtag,numctag,numbtag; numtag=numctag=numbtag=0; int num_class = ( num_labels / 2 ) + 1; vector<int> ccount(num_class,0),pcount(num_class,0),ncorrect(num_class,0), nleft(num_class,0),nright(num_class,0), nbcorrect(num_class,0),nbleft(num_class,0),nbright(num_class,0); int match,bmatch; match=bmatch=0; int num_seq = goldS.size(); for (int i = 0; i < num_seq ; ++i){ // For each sequence unsigned int N = goldS[i].size(); if ( N != predicted[i].size() ) { cerr << "Unmatching length of labels for sentence" << i << "\n"; abort(); } for ( unsigned int n = 0 ; n < N ; ++n, ++numtag ) { int clabel = goldS[i][n]; int cclass = class_type( clabel ); int cbraket = braket_type( n, goldS[i] ); if ( cbraket == SBrac || cbraket == BBrac ) { ccount[cclass]++; } int plabel = predicted[i][n]; int pclass = class_type( plabel ); int pbraket = braket_type( n, predicted[i] ); if ( pbraket == SBrac || pbraket == BBrac ) { pcount[pclass]++; } if ( cbraket == pbraket ) numbtag++; if ( clabel == plabel && cbraket == pbraket ) numctag++; if ( pbraket == SBrac && cbraket == SBrac ) { nbcorrect[pclass]++; nbleft[pclass]++; nbright[pclass]++; if( pclass == cclass ) { ncorrect[pclass]++; nleft[pclass]++; nright[pclass]++; } } else if ( pbraket == SBrac && cbraket == EBrac ) { nbright[pclass]++; if( pclass == cclass ) { nright[pclass]++; } } else if ( pbraket == SBrac && cbraket == BBrac ) { nbleft[pclass]++; if( pclass == cclass ) { nleft[pclass]++; } } else if ( pbraket == BBrac && cbraket == SBrac ) { nbleft[pclass]++; if( pclass == cclass ) { nleft[pclass]++; } } else if ( pbraket == BBrac && cbraket == BBrac ) { nbleft[pclass]++; bmatch=1; if( pclass == cclass ) { nleft[pclass]++; match=1;} } if ( pbraket != cbraket || pbraket == none ) bmatch = 0; if ( cclass != pclass || !bmatch ) match = 0; if ( pbraket == EBrac && cbraket == SBrac ) { nbright[pclass]++; if( pclass == cclass ) { nright[pclass]++; } } if ( pbraket == EBrac && cbraket == EBrac ) { if( bmatch ) nbcorrect[pclass]++; nbright[pclass]++; if( pclass == cclass ) { if ( match && ncorrect[pclass] <= pcount[pclass]) ncorrect[pclass]++; nright[pclass]++; } } } } Float score; int numans = getsum(pcount), numref = getsum(ccount); verbose_res vr("ALL",int(numref),int(numans)); if ( !numref ) cerr << "\n\nNo names in reference!\n"; if ( !numans ) cerr << "\n\nNo names in answers!\n"; Float ret_val = compute_score(getsum(ncorrect),numans,numref,"FULLY CORRECT answer",vr); VR.push_back(vr); if (num_class > 2) for( unsigned int cl = 1 ; cl < pcount.size() ; ++cl ) { string cl_str = LIS[reverse_class_type(cl)]; verbose_res vr_cl(string(cl_str,2,int(cl_str.size()-2)),ccount[cl],pcount[cl]); score = compute_score(ncorrect[cl],pcount[cl],ccount[cl],"FULLY CORRECT answer",vr_cl); VR.push_back(vr_cl); } if (ret_val>1.0) ret_val=1.0; return ret_val; }
void showplayerstats(engine_t *engine) { fprintf (stderr, "\n\t PLAYER STATISTICS\n\n\t" "Score %11d\n\t" "Efficiency %11d\n\t" "Score ratio %11d\n", GETSCORE (engine->score),engine->status.efficiency,GETSCORE (engine->score) / getsum ()); }