Submission #1004951

# Submission time Handle Problem Language Result Execution time Memory
1004951 2024-06-22T04:55:44 Z pavement Tiles (BOI24_tiles) C++17
0 / 100
84 ms 18984 KB
#include <bits/stdc++.h>
using namespace std;

using ll = long long;

#define pb push_back

int N, M, min_y = (int)1e9;
vector<int> try_x;
map<int, vector<int> > vec;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> N >> M;
	for (int i = 1, x, y; i <= N; i++) {
		cin >> x >> y;
		if (i != N) {
			vec[x].pb(y);
			if (x != 0) {
				try_x.pb(x - 1);
			}
			try_x.pb(x);
		}
	}
	int ans = 0;
	sort(try_x.begin(), try_x.end());
	try_x.erase(unique(try_x.begin(), try_x.end()), try_x.end());
	for (auto x : try_x) {
		int prv = min_y;
		for (auto y : vec[x]) {
			min_y = min(min_y, y);
		}
		if (prv != min_y) {
			if (x % 2 == 1 || min_y % 2 == 1) {
				break;
			}
		}
		//~ cout << x << " " << min_y << '\n';
		if (x % 2 == 0 && min_y % 2 == 0) {
			ans = x;
		}
	}
	cout << ans << '\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 13 ms 2776 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 45 ms 10416 KB Output is correct
3 Correct 37 ms 9256 KB Output is correct
4 Correct 40 ms 4444 KB Output is correct
5 Incorrect 37 ms 4560 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 84 ms 18984 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -