Problem powervillage
User Jinxuan
Submission Time 2023-12-30 12:51:59
Score 0
Max Time N/A
Max Memory N/A

Compile Error

powervillage.cpp: In function ‘int32_t main()’:
powervillage.cpp:8:13: error: expected initializer before ‘for’
8 | int b[n-1] for (int x= 0; x<n-1; x++) b[x] = a[x+1]-a[x];
| ^~~
powervillage.cpp:8:28: error: ‘x’ was not declared in this scope
8 | int b[n-1] for (int x= 0; x<n-1; x++) b[x] = a[x+1]-a[x];
| ^
powervillage.cpp:9:7: error: ‘b’ was not declared in this scope
9 | sort(b, b+n-1, greater<int>());
| ^