提出 #71704862


ソースコード 拡げる

N,M=[int(c)for c in input().split()]
A=set()
X=0
for _ in range(M):
  check=True
  R,C=[int(c)for c in input().split()]
  for dr in (-1,0,1):
    for dc in (-1,0,1):
      if (R+dr,C+dc)in A:
        check=False
        break
  if check:
    A.add((R,C))
    X+=1

print(X)

提出情報

提出日時
問題 C - 2x2 Placing
ユーザ Omanju
言語 Python (CPython 3.13.7)
得点 300
コード長 288 Byte
結果 AC
実行時間 514 ms
メモリ 42476 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 36
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 9 ms 9168 KiB
00_sample_01.txt AC 9 ms 9176 KiB
00_sample_02.txt AC 9 ms 9308 KiB
01_random_00.txt AC 133 ms 9132 KiB
01_random_01.txt AC 322 ms 9296 KiB
01_random_02.txt AC 271 ms 9120 KiB
01_random_03.txt AC 358 ms 9260 KiB
01_random_04.txt AC 131 ms 15600 KiB
01_random_05.txt AC 352 ms 10168 KiB
01_random_06.txt AC 292 ms 26792 KiB
01_random_07.txt AC 498 ms 40656 KiB
01_random_08.txt AC 336 ms 24896 KiB
01_random_09.txt AC 507 ms 42132 KiB
01_random_10.txt AC 105 ms 16516 KiB
01_random_11.txt AC 508 ms 42476 KiB
02_random2_00.txt AC 499 ms 42428 KiB
02_random2_01.txt AC 503 ms 42360 KiB
02_random2_02.txt AC 504 ms 42156 KiB
02_random2_03.txt AC 507 ms 41980 KiB
02_random2_04.txt AC 514 ms 41836 KiB
02_random2_05.txt AC 504 ms 41464 KiB
02_random2_06.txt AC 496 ms 41280 KiB
02_random2_07.txt AC 503 ms 41408 KiB
02_random2_08.txt AC 505 ms 41448 KiB
02_random2_09.txt AC 486 ms 41380 KiB
02_random2_10.txt AC 480 ms 33000 KiB
02_random2_11.txt AC 499 ms 31204 KiB
02_random2_12.txt AC 465 ms 28344 KiB
02_random2_13.txt AC 456 ms 25216 KiB
02_random2_14.txt AC 426 ms 17584 KiB
02_random2_15.txt AC 402 ms 9280 KiB
03_handmade_00.txt AC 327 ms 9212 KiB
03_handmade_01.txt AC 431 ms 25768 KiB
03_handmade_02.txt AC 451 ms 25752 KiB
03_handmade_03.txt AC 442 ms 25948 KiB
03_handmade_04.txt AC 425 ms 19656 KiB