Problem potatosalad
User shaokai348
Submission Time 2025-03-05 14:12:47
Score 0
Max Time N/A
Max Memory N/A

Compile Error

potatosalad.cpp: In function ‘int main()’:
potatosalad.cpp:7:7: error: ‘i’ was not declared in this scope
7 | for (i=0;i<N;i++){
| ^
potatosalad.cpp:8:10: error: ‘potatoes’ was not declared in this scope; did you mean ‘potato’?
8 | cin >> potatoes;
| ^~~~~~~~
| potato
potatosalad.cpp:9:10: error: ‘class std::vector<int>’ has no member named ‘pushback’; did you mean ‘push_back’?
9 | potato.pushback[potatoes];
| ^~~~~~~~
| push_back
potatosalad.cpp:11:35: error: ‘comp’ was not declared in this scope
11 | sort(potato.begin(),potato.end(),comp);
| ^~~~
potatosalad.cpp:12:7: error: ‘j’ was not declared in this scope
12 | for (j=0;j<D;j++){
| ^
potatosalad.cpp:14:18: error: ‘J’ was not declared in this scope
14 | Sum+=potato[N-J];
| ^