Submission #1103684

#TimeUsernameProblemLanguageResultExecution timeMemory
1103684melody_rulesTuna (COCI17_tuna)C++17
50 / 50
1 ms504 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int n=0; int x=0; int a=0; int b=0; int c=0; int i=0; cin>>n; cin>>x; for(i=0;i<n;i++) { cin>>a>>b; if(abs(a - b) > x) { cin>>a; c += a; } else c += max(a, b); } cout<<c<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...