Submission #71659804


Source Code Expand

#include <bits/stdc++.h>
//#include <windows.h>
//taskkill /f /im 未命名1.exe
#define ED cerr<<endl;
#define TS cerr<<"I AK IOI"<<endl;
#define cr(x) cerr<<x<<endl;
#define cr2(x,y) cerr<<x<<" "<<y<<endl;
#define cr3(x,y,z) cerr<<x<<" "<<y<<" "<<z<<endl;
#define cr4(x,y,z,w) cerr<<x<<" "<<y<<" "<<z<<" "<<w<<endl;
#define pr(a,l,r) for(int i=l;i<=r;++i) cerr<<a[i]<<' ';ED
#define popcnt __builtin_popcount
#define all(s) s.begin(),s.end()
#define bstring basic_string
//#define add(x,y) (x+=y)%=mod
#define pii pair<int,int>
#define epb emplace_back
#define pb push_back
#define mk make_pair
#define ins insert
#define fi first
#define se second
#define ll long long
#define ull unsigned long long
using namespace std;
const int N=105,INF=2e9,mod=1e9+7;
int t,n,m,ans=0;
map<pii,int> app;

int main()
{
	scanf("%d%d",&n,&m);
	int x,y;
	for(int t=1;t<=m;++t) {
		scanf("%d%d",&x,&y);
		int ok=1;
		for(int i=x-1;i<=x+1;++i) {
			for(int j=y-1;j<=y+1;++j) {
				if(app[{i,j}]) {
					ok=0;break;
				}
			}
		}
		if(ok) ++ans,app[{x,y}]=1;
	}
	printf("%d\n",ans);
	return 0;
}

Submission Info

Submission Time
Task C - 2x2 Placing
User Include_S_Z_C_
Language C++23 (GCC 15.2.0)
Score 300
Code Size 1127 Byte
Status AC
Exec Time 808 ms
Memory 116368 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 3628 KiB
00_sample_01.txt AC 1 ms 3704 KiB
00_sample_02.txt AC 1 ms 3780 KiB
01_random_00.txt AC 11 ms 3752 KiB
01_random_01.txt AC 22 ms 3764 KiB
01_random_02.txt AC 28 ms 3932 KiB
01_random_03.txt AC 122 ms 3996 KiB
01_random_04.txt AC 134 ms 25288 KiB
01_random_05.txt AC 174 ms 5544 KiB
01_random_06.txt AC 422 ms 66864 KiB
01_random_07.txt AC 808 ms 110820 KiB
01_random_08.txt AC 447 ms 59620 KiB
01_random_09.txt AC 785 ms 115844 KiB
01_random_10.txt AC 91 ms 27128 KiB
01_random_11.txt AC 615 ms 116368 KiB
02_random2_00.txt AC 598 ms 116304 KiB
02_random2_01.txt AC 601 ms 115636 KiB
02_random2_02.txt AC 602 ms 114868 KiB
02_random2_03.txt AC 604 ms 113720 KiB
02_random2_04.txt AC 593 ms 112732 KiB
02_random2_05.txt AC 602 ms 111048 KiB
02_random2_06.txt AC 613 ms 109156 KiB
02_random2_07.txt AC 606 ms 106140 KiB
02_random2_08.txt AC 591 ms 102424 KiB
02_random2_09.txt AC 593 ms 97464 KiB
02_random2_10.txt AC 570 ms 90168 KiB
02_random2_11.txt AC 530 ms 81860 KiB
02_random2_12.txt AC 462 ms 68280 KiB
02_random2_13.txt AC 385 ms 52068 KiB
02_random2_14.txt AC 262 ms 30520 KiB
02_random2_15.txt AC 105 ms 4148 KiB
03_handmade_00.txt AC 23 ms 3780 KiB
03_handmade_01.txt AC 227 ms 60036 KiB
03_handmade_02.txt AC 281 ms 66448 KiB
03_handmade_03.txt AC 299 ms 60036 KiB
03_handmade_04.txt AC 327 ms 61992 KiB