Submission #1110622

# Submission time Handle Problem Language Result Execution time Memory
1110622 2024-11-10T06:19:55 Z vjudge1 Tuna (COCI17_tuna) C++17
0 / 50
1 ms 336 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long

int32_t main() {
    int t,m,para,H,Z,S;
    cin>>t>>m;
    for (int i = 0; i < t; i++)
    {
        cin>>H>>Z;
        if(max(H-Z,Z-H)<=m)
        {
            para+=max(H,Z);
        }
        else
        {
            cin>>S;
            para+=S;
        }
    }
    cout<<para;
}

Compilation message

tuna.cpp: In function 'int32_t main()':
tuna.cpp:13:17: warning: 'para' may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |             para+=max(H,Z);
      |             ~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -