Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <string>
- #include <cmath>
- #include <set>
- #include <map>
- using namespace std;
- using ll = long long;
- int main()
- {
- int n;
- cin>>n;
- int mx = -1;
- int R1,R2,R3;
- int ans;
- for (int i = 1; i < n+1;++i){
- cin>>R1>>R2>>R3;
- if (i == 1){
- mx = R1 + R2 + R3;
- ans = i;
- }
- else{
- int crnt = R1 + R2 + R3;
- if (crnt > mx){
- mx = crnt;
- ans = i;
- }
- }
- }
- int rlns;
- cin>>rlns;
- cout<<ans<<'\n';
- if (ans == rlns)cout<<"OK\n";
- else cout<<"WA\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement