Submission #1110690

#TimeUsernameProblemLanguageResultExecution timeMemory
1110690vjudge1Tuna (COCI17_tuna)C++17
0 / 50
1 ms336 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, x, a, b, awnser; cin>>n>>x; for(int i = 0 ; i < n ; i++){ cin>>a>>b; if(max(a, b) - min(a, b) <= x) awnser += max(a, b); else{ cin>>a; awnser += a; } } cout<<awnser; return 0; }

Compilation message (stderr)

tuna.cpp: In function 'int main()':
tuna.cpp:15:8: warning: 'awnser' may be used uninitialized in this function [-Wmaybe-uninitialized]
   15 |  cout<<awnser;
      |        ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...