Borderou de evaluare (job #1715065)
Raport evaluator
Compilare:
user.cpp: In function ‘int main()’:
user.cpp:2:156: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
int max(int a, int b){return a > b ? a : b;}int d[2][2];int main(){int n;FILE*fi,*fo;fi=fopen("suma2.in","r");fo=fopen("suma2.out","w");fscanf(fi,"%d", &n);for(int i=1;i<=n;i++){int x;fscanf(fi,"%d", &x);d[1][0]=max(d[0][0], d[0][1]);d[1][1]=max(x+d[0][0], x);d[0][0]=d[1][0];d[0][1]=d[1][1];}fprintf(fo,"%d", max(d[0][0], d[0][1]));fclose(fi);fclose(fo);return 0;}
^
user.cpp:2:204: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
int max(int a, int b){return a > b ? a : b;}int d[2][2];int main(){int n;FILE*fi,*fo;fi=fopen("suma2.in","r");fo=fopen("suma2.out","w");fscanf(fi,"%d", &n);for(int i=1;i<=n;i++){int x;fscanf(fi,"%d", &x);d[1][0]=max(d[0][0], d[0][1]);d[1][1]=max(x+d[0][0], x);d[0][0]=d[1][0];d[0][1]=d[1][1];}fprintf(fo,"%d", max(d[0][0], d[0][1]));fclose(fi);fclose(fo);return 0;}
^
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
1 | 0ms | 268kb | OK | 10 |
2 | 0ms | 260kb | OK | 10 |
3 | 0ms | 268kb | OK | 10 |
4 | 0ms | 260kb | OK | 10 |
5 | 4ms | 260kb | OK | 10 |
6 | 4ms | 260kb | OK | 10 |
7 | 8ms | 264kb | OK | 10 |
8 | 20ms | 256kb | OK | 10 |
9 | 36ms | 268kb | OK | 10 |
10 | 48ms | 264kb | OK | 10 |
Punctaj total | 100 |