Submission #71664353


Source Code Expand

#include <bits/stdc++.h>

using namespace std;
int n, m, ans;
map<pair<int, int>, bool> mp;
signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin >> n >> m;
	for(int i = 1; i <= m; i ++) {
		int x, y;
		cin >> x >> y;
		if(mp[{x, y}] || mp[{x + 1, y}] || mp[{x, y + 1}] || mp[{x + 1, y + 1}]) continue;
		ans ++;
		mp[{x, y}] = mp[{x + 1, y}] = mp[{x, y + 1}] = mp[{x + 1, y + 1}] = 1;
	}
	cout << ans << '\n';
	return 0;
}

Submission Info

Submission Time
Task C - 2x2 Placing
User WangYueHeng
Language C++23 (GCC 15.2.0)
Score 300
Code Size 462 Byte
Status AC
Exec Time 459 ms
Memory 53612 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 36
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 02_random2_08.txt, 02_random2_09.txt, 02_random2_10.txt, 02_random2_11.txt, 02_random2_12.txt, 02_random2_13.txt, 02_random2_14.txt, 02_random2_15.txt, 03_handmade_00.txt, 03_handmade_01.txt, 03_handmade_02.txt, 03_handmade_03.txt, 03_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3528 KiB
00_sample_01.txt AC 1 ms 3440 KiB
00_sample_02.txt AC 1 ms 3644 KiB
01_random_00.txt AC 6 ms 3448 KiB
01_random_01.txt AC 10 ms 3512 KiB
01_random_02.txt AC 13 ms 3452 KiB
01_random_03.txt AC 30 ms 3704 KiB
01_random_04.txt AC 69 ms 14256 KiB
01_random_05.txt AC 50 ms 5368 KiB
01_random_06.txt AC 220 ms 32056 KiB
01_random_07.txt AC 444 ms 51784 KiB
01_random_08.txt AC 234 ms 31056 KiB
01_random_09.txt AC 459 ms 53368 KiB
01_random_10.txt AC 58 ms 13904 KiB
01_random_11.txt AC 404 ms 53560 KiB
02_random2_00.txt AC 380 ms 53584 KiB
02_random2_01.txt AC 387 ms 53612 KiB
02_random2_02.txt AC 388 ms 52964 KiB
02_random2_03.txt AC 369 ms 52816 KiB
02_random2_04.txt AC 369 ms 52400 KiB
02_random2_05.txt AC 367 ms 51832 KiB
02_random2_06.txt AC 358 ms 51044 KiB
02_random2_07.txt AC 371 ms 50148 KiB
02_random2_08.txt AC 362 ms 49116 KiB
02_random2_09.txt AC 342 ms 47064 KiB
02_random2_10.txt AC 331 ms 44208 KiB
02_random2_11.txt AC 311 ms 40844 KiB
02_random2_12.txt AC 263 ms 34808 KiB
02_random2_13.txt AC 198 ms 27364 KiB
02_random2_14.txt AC 122 ms 17340 KiB
02_random2_15.txt AC 31 ms 3852 KiB
03_handmade_00.txt AC 10 ms 3692 KiB
03_handmade_01.txt AC 137 ms 28600 KiB
03_handmade_02.txt AC 182 ms 41200 KiB
03_handmade_03.txt AC 143 ms 28508 KiB
03_handmade_04.txt AC 138 ms 32632 KiB