Pagini recente » Borderou de evaluare (job #2520) | Borderou de evaluare (job #294198) | Borderou de evaluare (job #2603010)
Borderou de evaluare (job #2603010)
Raport evaluator
Compilare:
main.cpp:2:28: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
int d[100000],n,i,j,l;main(){FILE*y=fopen("jocul.in","r"),*z=fopen("jocul.out","w");fscanf(y,"%d",&n);d[0]=1;int x=0,s=0;for(i=0;i<n;i++){fscanf(y,"%d",&l);s+=l;for(j=x;j>=0;j--)if(d[j]==1)d[j+l]=1;x=x+l;}i=s/2;while(d[i]==0)i--;fprintf(z,"%d %d",i,s-i);}
^
main.cpp: In function 'int main()':
main.cpp:2:102: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
int d[100000],n,i,j,l;main(){FILE*y=fopen("jocul.in","r"),*z=fopen("jocul.out","w");fscanf(y,"%d",&n);d[0]=1;int x=0,s=0;for(i=0;i<n;i++){fscanf(y,"%d",&l);s+=l;for(j=x;j>=0;j--)if(d[j]==1)d[j+l]=1;x=x+l;}i=s/2;while(d[i]==0)i--;fprintf(z,"%d %d",i,s-i);}
^
main.cpp:2:156: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
int d[100000],n,i,j,l;main(){FILE*y=fopen("jocul.in","r"),*z=fopen("jocul.out","w");fscanf(y,"%d",&n);d[0]=1;int x=0,s=0;for(i=0;i<n;i++){fscanf(y,"%d",&l);s+=l;for(j=x;j>=0;j--)if(d[j]==1)d[j+l]=1;x=x+l;}i=s/2;while(d[i]==0)i--;fprintf(z,"%d %d",i,s-i);}
^
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
Punctaj/grupa |
1 | 2ms | 131kb | OK | 10 | 40 |
2 | 2ms | 131kb | OK | 10 |
3 | 2ms | 131kb | OK | 10 |
4 | 8ms | 131kb | OK | 10 |
5 | 24ms | 262kb | OK | 10 | 40 |
6 | 2ms | 131kb | OK | 10 |
7 | 39ms | 262kb | OK | 10 |
8 | 10ms | 131kb | OK | 10 |
9 | 4ms | 131kb | OK | 10 | 20 |
10 | 57ms | 262kb | OK | 10 |
Punctaj total | 100 |