結果
| 問題 | No.202 1円玉投げ |
| コンテスト | |
| ユーザー |
Tawara
|
| 提出日時 | 2015-08-04 23:22:08 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 409 bytes |
| 記録 | |
| コンパイル時間 | 152 ms |
| コンパイル使用メモリ | 77,480 KB |
| 最終ジャッジ日時 | 2025-12-03 16:07:45 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | MLE * 1 -- * 37 |
ソースコード
import sys
def dfs(cx,cy,hx,hy):
ones.add((hx,hy))
for i in range(4):
nx = hx + dx[i]; ny = hy + dy[i]
if (nx,ny) not in ones and (cx-nx)**2 + (cy-ny)**2 < 400:
dfs(cx,cy,nx,ny)
dx = (1,0,-1,0)
dy = (0,1,0,-1)
sys.setrecursionlimit(10000000)
ones = set()
N = int(raw_input())
ans = 0
for i in range(N):
x,y = map(int,raw_input().split(" "))
if (x,y) not in ones:
ans += 1
dfs(x,y,x,y)
print ans
Tawara