Submission #1110612

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