Submission #1110690

# Submission time Handle Problem Language Result Execution time Memory
1110690 2024-11-10T08:10:04 Z vjudge1 Tuna (COCI17_tuna) C++17
0 / 50
1 ms 336 KB
#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

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 time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -