Submission #397504

#TimeUsernameProblemLanguageResultExecution timeMemory
397504IwanttobreakfreeTuna (COCI17_tuna)C++98
50 / 50
1 ms296 KiB
#include <iostream> using namespace std; int main(){ long long int n,x,p1,p2,p3,dif,sum=0; cin>>n>>x; while(n--){ cin>>p1>>p2; dif=p2-p1; p3=max(p2,p1); if(dif<0)dif*=-1; if(dif>x)cin>>p3; sum+=p3; } cout<<sum; }
#Verdict Execution timeMemoryGrader output
Fetching results...