Submission #397615

#TimeUsernameProblemLanguageResultExecution timeMemory
397615victoriadTuna (COCI17_tuna)C++14
50 / 50
1 ms320 KiB
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <utility> #include <queue> #include <map> #include <iomanip> #include <fstream> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(NULL); int n,x,a,b,c,r=0; cin>>n>>x; for(int i=0;i<n;i++){ cin>>a>>b; int y=abs(a-b); if(y<=x){ r+=max(a,b); } else{ cin>>c; r+=c; } } cout<<r; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...