結果
問題 | No.202 1円玉投げ |
ユーザー |
![]() |
提出日時 | 2021-08-30 21:57:24 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 316 ms / 5,000 ms |
コード長 | 1,093 bytes |
コンパイル時間 | 279 ms |
コンパイル使用メモリ | 81,940 KB |
実行使用メモリ | 107,848 KB |
最終ジャッジ日時 | 2024-12-22 12:10:02 |
合計ジャッジ時間 | 8,585 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
import sys def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N = I() area = [[[] for _ in range(801)] for _ in range(801)] XY = [] R = [-1,0,1] ans = 0 for k in range(N): x,y = MI() XY.append((x,y)) i = x//25 j = y//25 is_eliminated = 0 for di in R: ni = i+di if not (0 <= ni < 801): continue for dj in R: nj = j+dj if not (0 <= nj < 801): continue for l in area[ni][nj]: xl,yl = XY[l] if (x-xl)**2+(y-yl)**2 < 400: is_eliminated = 1 break if is_eliminated: continue else: area[i][j].append(k) ans += 1 print(ans)