Submission #1110668

# Submission time Handle Problem Language Result Execution time Memory
1110668 2024-11-10T07:26:38 Z vjudge1 Tuna (COCI17_tuna) C++
50 / 50
1 ms 372 KB
// Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
int main() {
    int x = 0;
    int sayac = 0;
    cin >> x;
    int y = 0;
    int s = 0;
    cin >> y;
    for(int i = 0;i < x;i++){
        int z = 0;
        int h = 0;
        cin>>z;
         cin>>h;
        if(abs(h-z) <= y){
            sayac+=max(h ,z);
        }else{
            cin >> s;
            sayac+=s;
        }
        
    }
    cout << sayac;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 372 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct