Submission #1110653

# Submission time Handle Problem Language Result Execution time Memory
1110653 2024-11-10T07:00:31 Z vjudge1 Tuna (COCI17_tuna) C++17
0 / 50
1 ms 336 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(void)
{
    int n, x;
    cin >> n >> x;
    int sum = 0;

    for(int i = 0 ; i < n ; ++i)
    {
        int a, b;
        cin >> a >> b;
        if(abs(a - b) > x)
        {
            int c;
            cin >> c;
            sum += c;
        }
        else if(a < b)
        {
            sum += b;
        }
        else
        {
            sum += a;
        }
        cout << sum;
    }
	
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -