結果

問題 No.202 1円玉投げ
ユーザー Mao-betaMao-beta
提出日時 2024-04-05 12:18:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,284 ms / 5,000 ms
コード長 1,295 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 443,776 KB
最終ジャッジ日時 2024-04-05 12:19:00
合計ジャッジ時間 43,794 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,162 ms
443,776 KB
testcase_01 AC 1,280 ms
440,572 KB
testcase_02 AC 710 ms
411,696 KB
testcase_03 AC 735 ms
411,696 KB
testcase_04 AC 708 ms
411,696 KB
testcase_05 AC 865 ms
425,588 KB
testcase_06 AC 1,217 ms
437,880 KB
testcase_07 AC 1,272 ms
438,984 KB
testcase_08 AC 1,268 ms
438,992 KB
testcase_09 AC 1,148 ms
434,440 KB
testcase_10 AC 930 ms
427,548 KB
testcase_11 AC 1,002 ms
429,888 KB
testcase_12 AC 971 ms
430,028 KB
testcase_13 AC 930 ms
427,696 KB
testcase_14 AC 904 ms
425,716 KB
testcase_15 AC 1,122 ms
434,172 KB
testcase_16 AC 1,188 ms
443,264 KB
testcase_17 AC 1,118 ms
443,136 KB
testcase_18 AC 1,115 ms
443,136 KB
testcase_19 AC 988 ms
430,308 KB
testcase_20 AC 1,203 ms
437,048 KB
testcase_21 AC 1,007 ms
430,304 KB
testcase_22 AC 835 ms
424,776 KB
testcase_23 AC 815 ms
424,776 KB
testcase_24 AC 809 ms
424,904 KB
testcase_25 AC 824 ms
424,776 KB
testcase_26 AC 828 ms
424,904 KB
testcase_27 AC 811 ms
424,776 KB
testcase_28 AC 853 ms
424,904 KB
testcase_29 AC 833 ms
424,904 KB
testcase_30 AC 822 ms
424,904 KB
testcase_31 AC 834 ms
424,776 KB
testcase_32 AC 846 ms
424,776 KB
testcase_33 AC 821 ms
424,904 KB
testcase_34 AC 849 ms
424,776 KB
testcase_35 AC 1,097 ms
443,264 KB
testcase_36 AC 1,155 ms
441,472 KB
testcase_37 AC 1,284 ms
439,808 KB
testcase_38 AC 1,094 ms
443,392 KB
testcase_39 AC 802 ms
424,368 KB
testcase_40 AC 838 ms
424,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
import bisect
from heapq import heapify, heappop, heappush
from collections import deque, defaultdict, Counter
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product

sys.set_int_max_str_digits(10 ** 6)
sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
MOD99 = 998244353

input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()
SMI = lambda: input().split()
SLI = lambda: list(SMI())
EI = lambda m: [NLI() for _ in range(m)]


def main():
    N = NI()
    XY = EI(N)
    C = [[[-1, -1] for _ in range(2002)] for _ in range(2002)]
    DX = [-2, -1, 0, 1, 2] * 5
    DY = [-2] * 5 + [-1] * 5 + [0] * 5 + [1] * 5 + [2] * 5
    ans = 0
    for x, y in XY:
        xx, yy = x // 10, y // 10
        ok = True
        for dx, dy in zip(DX, DY):
            nx, ny = xx+dx, yy+dy
            if 0 <= nx < 2002 and 0 <= ny < 2002:
                cx, cy = C[nx][ny]
                if cx == cy == -1:
                    continue
                if (cx-x)**2 + (cy-y)**2 < 400:
                    ok = False
        if ok:
            C[xx][yy] = [x, y]
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()
0