|
|
вернуться в форум10 WA, what's wrong with my code? Послано Mgccl 8 апр 2009 14:25 int main(int argc, char **argv){ char s[6]; int n,i,t; unsigned int a[100001]; unsigned short b[100001]; unsigned int f[1001]; unsigned int d; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s", s); if(s[1]=='U'){ scanf("%d %u", &t, &d); a[i]=d<<1; b[i]=f[t]>>1; a[i]+=f[t]&1; f[t]=i; }else{ scanf("%d",&t); printf("%u\n",a[f[t]]>>1); f[t] = (((int)b[f[t]])<<1)+(a[f[t]]&1); } } return 0; } Re: 10 WA, what's wrong with my code? You should set f[0] - f[1001] = 0 |
|
|