Submission #1067125

# Submission time Handle Problem Language Result Execution time Memory
1067125 2024-08-20T11:45:37 Z 0npata Tiles (BOI24_tiles) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define vec vector

const INF = 1e17;

int32_t main() {
	int n, m;
	cin >> n >> m;

	int l = INF, r = -INF, u = -INF, d = INF;
	for(int i = 0; i<n; i++) {
		int x, y;
		cin >> x >> y;
		l = min(l, x);
		r = max(r, x);
		u = max(u, y);
		d = min(d, y);
	}

	if((u-d)%2) {
		cout << l << '\n';
		return;
	}
	cout << (r)-((r-l)%2) << '\n';
}

Compilation message

Main.cpp:7:7: error: 'INF' does not name a type
    7 | const INF = 1e17;
      |       ^~~
Main.cpp: In function 'int32_t main()':
Main.cpp:13:10: error: 'INF' was not declared in this scope
   13 |  int l = INF, r = -INF, u = -INF, d = INF;
      |          ^~~
Main.cpp:18:3: error: 'r' was not declared in this scope
   18 |   r = max(r, x);
      |   ^
Main.cpp:19:3: error: 'u' was not declared in this scope
   19 |   u = max(u, y);
      |   ^
Main.cpp:20:3: error: 'd' was not declared in this scope
   20 |   d = min(d, y);
      |   ^
Main.cpp:23:6: error: 'u' was not declared in this scope
   23 |  if((u-d)%2) {
      |      ^
Main.cpp:23:8: error: 'd' was not declared in this scope
   23 |  if((u-d)%2) {
      |        ^
Main.cpp:25:3: error: return-statement with no value, in function returning 'int32_t' {aka 'int'} [-fpermissive]
   25 |   return;
      |   ^~~~~~
Main.cpp:27:11: error: 'r' was not declared in this scope
   27 |  cout << (r)-((r-l)%2) << '\n';
      |           ^