Submission #420894

# Submission time Handle Problem Language Result Execution time Memory
420894 2021-06-08T14:42:27 Z MetalPower Izvanzemaljci (COI21_izvanzemaljci) C++14
5 / 100
27 ms 312 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long

int N, K;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);

	cin >> N >> K;

	if(K == 1){

		ll min_x, max_x, min_y, max_y;

		for(int i = 0; i < N; i++){
			ll x, y; cin >> x >> y;

			if(i == 0){
				min_x = max_x = x;
				min_y = max_y = y;
			}else{
				min_x = min(min_x, x);
				max_x = max(max_x, x);
				min_y = min(min_y, y);
				max_y = max(max_y, y);
			}
		}

		cout << min_x << " " << min_y << " " << max(1ll, max(max_x - min_x, max_y - min_y)) << '\n';

	}else{
		cout << "AC" << '\n';
	}
}

Compilation message

izvanzemaljci.cpp: In function 'int main()':
izvanzemaljci.cpp:31:77: warning: 'max_y' may be used uninitialized in this function [-Wmaybe-uninitialized]
   31 |   cout << min_x << " " << min_y << " " << max(1ll, max(max_x - min_x, max_y - min_y)) << '\n';
      |                                                                       ~~~~~~^~~~~~~
izvanzemaljci.cpp:31:77: warning: 'min_y' may be used uninitialized in this function [-Wmaybe-uninitialized]
izvanzemaljci.cpp:31:62: warning: 'max_x' may be used uninitialized in this function [-Wmaybe-uninitialized]
   31 |   cout << min_x << " " << min_y << " " << max(1ll, max(max_x - min_x, max_y - min_y)) << '\n';
      |                                                        ~~~~~~^~~~~~~
izvanzemaljci.cpp:31:62: warning: 'min_x' may be used uninitialized in this function [-Wmaybe-uninitialized]
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 26 ms 312 KB Output is correct
8 Correct 26 ms 312 KB Output is correct
9 Correct 27 ms 308 KB Output is correct
10 Correct 26 ms 312 KB Output is correct
11 Correct 26 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "AC" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "AC" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "AC" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "AC" found
2 Halted 0 ms 0 KB -