Borderou de evaluare (job #821714)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Semisume | Compilator | cpp-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 28 apr. 2025 09:51:06 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:13:18: error: expected ';' before '+=' token
13 | for(int k+=i,j=min(k,n*(n+1)/4);j>=i;a[j]+=a[j-i],--j);
| ^~
| ;
main.cpp:13:18: error: expected primary-expression before '+=' token
13 | for(int k+=i,j=min(k,n*(n+1)/4);j>=i;a[j]+=a[j-i],--j);
| ^~
main.cpp:13:42: warning: for increment expression has no effect [-Wunused-value]
13 | for(int k+=i,j=min(k,n*(n+1)/4);j>=i;a[j]+=a[j-i],--j);
| ~^~~
main.cpp:13:45: error: expected ')' before ';' token
13 | for(int k+=i,j=min(k,n*(n+1)/4);j>=i;a[j]+=a[j-i],--j);
| ~ ^
| )
main.cpp:13:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
13 | for(int k+=i,j=min(k,n*(n+1)/4);j>=i;a[j]+=a[j-i],--j);
| ^~~
main.cpp:13:46: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
13 | for(int k+=i,j=min(k,n*(n+1)/4);j>=i;a[j]+=a[j-i],--j);
| ^
main.cpp:12:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
12 | for(int i=1;i<=n;++i)
| ^~~
main.cpp:13:46: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
13 | for(int k+=i,j=min(k,n*(n+1)/4);j>=i;a[j]+=a[j-i],--j);
| ^
main.cpp:13:56: error: 'i' was not declared in this scope
13 | for(int k+=i,j=min(k,n*(n+1)/4);j>=i;a[j]+=a[j-i],--j);
| ^
main.cpp:8:13: warning: unused variable 'k' [-Wunused-variable]
8 | int j=0,k=0,n;
| ^