結果
問題 |
No.202 1円玉投げ
|
ユーザー |
![]() |
提出日時 | 2015-06-06 21:01:02 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 837 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-22 09:23:33 |
合計ジャッジ時間 | 2,472 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 38 |
ソースコード
''' Created on 2015/06/06 @author: kiyo ''' import math def main(): def check(x, y): for dy in range(-1, 2): for dx in range(-1, 2): bx, by = x // size + dx, y // size + dy if 0 <= bx < 20000 // size + 1 and 0 <= by < 20000 //size + 1: for cx, cy in L[bx][by]: if (x-cx)**2 + (y-cy)**2 < 400: return False; return True; n = int(input()) size = math.sqrt(20000)//1 print(size) L = [[[] for i in range(20000 // size + 1)] for j in range(20000 // size + 1)] ans = 0 for i in range(n): x, y = map(int, input().split()) if check(x, y): ans += 1 L[x//size][y//size].append((x, y)) print(ans) if __name__ == '__main__': main()