# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
599437 | DrollWolf | Tuna (COCI17_tuna) | C++17 | 1 ms | 300 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
//const int N = 2*(10e5+7);
//int arr[N];
int main()
{
lli t, n, c, a, b, ans, i, x;
char ch;
ans=0;
cin>>n>>x;
string str;
while(n--)
{
cin>>a>>b;
if(abs(a-b)<=x)
ans+=max(a, b);
else
{
cin>>c;
ans+=c;
}
}
cout<<ans<<'\n';
//freopen("diamond.in","r",stdin);
//freopen("diamond.out","w",stdout);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |