답안 #1004952

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1004952 2024-06-22T04:56:54 Z pavement Tiles (BOI24_tiles) C++17
0 / 100
76 ms 18880 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 && prv % 2 == 0) {
			ans = x;
		}
	}
	cout << ans << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 10 ms 2776 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 46 ms 10544 KB Output is correct
3 Correct 42 ms 9116 KB Output is correct
4 Correct 32 ms 3276 KB Output is correct
5 Incorrect 32 ms 3280 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 76 ms 18880 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -