Problem competition
User wahjsodhowasd
Submission Time 2026-02-13 21:58:11
Score 0
Max Time N/A
Max Memory N/A

Compile Error

competition.cpp: In function ‘int main()’:
competition.cpp:13:3: error: ‘class std::vector<std::pair<int, int> >’ has no member named ‘first’
13 | v.first.push_back(x);}
| ^~~~~
competition.cpp:16:3: error: ‘class std::vector<std::pair<int, int> >’ has no member named ‘second’
16 | v.second.push_back(y);
| ^~~~~~
competition.cpp:19:42: error: expected primary-expression before ‘)’ token
19 | sort(diff.begin(),diff.end(),greater<int>)
| ^
competition.cpp:20:14: error: ‘i’ was not declared in this scope
20 | for (int i=0;i<a;i++){
| ^
competition.cpp: At global scope:
competition.cpp:22:1: error: ‘Ans’ does not name a type
22 | Ans+=accumulate(v.second.begin(),v.second.end(),0);
| ^~~
competition.cpp:23:1: error: ‘cout’ does not name a type
23 | cout<<Ans;
| ^~~~