제출 #646097

#제출 시각아이디문제언어결과실행 시간메모리
646097Ghosty_v2Tuna (COCI17_tuna)C++14
50 / 50
1 ms324 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ios_base::sync_with_stdio(false); cin.tie(0); ll n,x; cin>>n>>x; ll sum = 0; for(int i=0;i<n;i++) { ll a,b,c; cin>>a>>b; if (abs(a-b) > x) { cin>>c; sum+=c; } else{ if (a >= b) { sum+=a; } else { sum+=b; } } } cout<<sum<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...