Borderou de evaluare (job #1987495)

Utilizator georgerapeanuRapeanu George georgerapeanu Data 30 mai 2017 21:02:39
Problema Ackermann Status done
Runda Arhiva ICPC Compilator cpp | Vezi sursa
Scor 100

Raport evaluator

Compilare: user.cpp: In function ‘I main()’: user.cpp:2:316: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] typedef int I;I t,a,b,p;I r(I b,I p){if(p<=1)return 0;if(b==1)return a%p;I v=p,h=p;for(I i=2;i*i<=p;++i)if(p%i==0){while(p%i==0) p=p/i;v=v/i*(i-1);}if(p!=1)v=v/p*(p-1);I e=r(b-1,v);I g=1;p=h;h=a%p;for(I i=0;(1<<i)<=e;++i){if((1<<i)&e)g=(1LL*g*h)%p;h=(1LL*h*h)%p;}return g;}I main(){freopen("ackermann.in","r",stdin);freopen("ackermann.out","w",stdout);scanf("%d",&t);while(t--)scanf("%d%d%d",&a,&b,&p),printf("%d\n",r(b,p));return 0;} ^ user.cpp:2:352: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] typedef int I;I t,a,b,p;I r(I b,I p){if(p<=1)return 0;if(b==1)return a%p;I v=p,h=p;for(I i=2;i*i<=p;++i)if(p%i==0){while(p%i==0) p=p/i;v=v/i*(i-1);}if(p!=1)v=v/p*(p-1);I e=r(b-1,v);I g=1;p=h;h=a%p;for(I i=0;(1<<i)<=e;++i){if((1<<i)&e)g=(1LL*g*h)%p;h=(1LL*h*h)%p;}return g;}I main(){freopen("ackermann.in","r",stdin);freopen("ackermann.out","w",stdout);scanf("%d",&t);while(t--)scanf("%d%d%d",&a,&b,&p),printf("%d\n",r(b,p));return 0;} ^ user.cpp:2:367: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] typedef int I;I t,a,b,p;I r(I b,I p){if(p<=1)return 0;if(b==1)return a%p;I v=p,h=p;for(I i=2;i*i<=p;++i)if(p%i==0){while(p%i==0) p=p/i;v=v/i*(i-1);}if(p!=1)v=v/p*(p-1);I e=r(b-1,v);I g=1;p=h;h=a%p;for(I i=0;(1<<i)<=e;++i){if((1<<i)&e)g=(1LL*g*h)%p;h=(1LL*h*h)%p;}return g;}I main(){freopen("ackermann.in","r",stdin);freopen("ackermann.out","w",stdout);scanf("%d",&t);while(t--)scanf("%d%d%d",&a,&b,&p),printf("%d\n",r(b,p));return 0;} ^ user.cpp:2:424: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] typedef int I;I t,a,b,p;I r(I b,I p){if(p<=1)return 0;if(b==1)return a%p;I v=p,h=p;for(I i=2;i*i<=p;++i)if(p%i==0){while(p%i==0) p=p/i;v=v/i*(i-1);}if(p!=1)v=v/p*(p-1);I e=r(b-1,v);I g=1;p=h;h=a%p;for(I i=0;(1<<i)<=e;++i){if((1<<i)&e)g=(1LL*g*h)%p;h=(1LL*h*h)%p;}return g;}I main(){freopen("ackermann.in","r",stdin);freopen("ackermann.out","w",stdout);scanf("%d",&t);while(t--)scanf("%d%d%d",&a,&b,&p),printf("%d\n",r(b,p));return 0;} ^
Test Timp executie Memorie folosita Mesaj Punctaj/test
120ms280kbOK100
Punctaj total100

Ceva nu functioneaza?