Pagini recente » Borderou de evaluare (job #3187418) | Borderou de evaluare (job #1088622) | Borderou de evaluare (job #1507723) | Borderou de evaluare (job #3135374) | Borderou de evaluare (job #1715069)
Borderou de evaluare (job #1715069)
Raport evaluator
Compilare:
user.cpp: In function ‘int main()’:
user.cpp:2:153: 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[4];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[2]=max(d[0], d[1]);d[3]=max(x+d[0], x);d[0]=d[2];d[1]=d[3];}fprintf(fo,"%d", max(d[0], d[1]));return 0;}
^
user.cpp:2:201: 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[4];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[2]=max(d[0], d[1]);d[3]=max(x+d[0], x);d[0]=d[2];d[1]=d[3];}fprintf(fo,"%d", max(d[0], d[1]));return 0;}
^
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
1 | 0ms | 272kb | OK | 10 |
2 | 0ms | 272kb | OK | 10 |
3 | 0ms | 268kb | OK | 10 |
4 | 0ms | 264kb | OK | 10 |
5 | 4ms | 268kb | OK | 10 |
6 | 4ms | 272kb | OK | 10 |
7 | 8ms | 264kb | OK | 10 |
8 | 20ms | 264kb | OK | 10 |
9 | 36ms | 264kb | OK | 10 |
10 | 48ms | 268kb | OK | 10 |
Punctaj total | 100 |