結果
問題 | No.513 宝探し2 |
ユーザー |
|
提出日時 | 2017-05-05 22:37:52 |
言語 | PyPy2 (7.3.15) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 623 bytes |
コンパイル時間 | 2,135 ms |
コンパイル使用メモリ | 76,580 KB |
実行使用メモリ | 122,816 KB |
最終ジャッジ日時 | 2024-07-17 00:57:49 |
合計ジャッジ時間 | 7,819 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 11 |
ソースコード
import sysimport randomN = 100001print 0, 0sys.stdout.flush()d = int(raw_input())s = set()for r in xrange(N):c = d - rif c < 0:continues.add((r, c))while len(s) > 1:r, c = random.sample(s, 1)[0]sys.stdout.flush()d = int(raw_input())new_s = set()for dr in xrange(-d, d+1):nr = r + drnc = c + d - abs(dr)if nr >= 0 and nr < N and nc >= 0 and nc < N:new_s.add((nr, nc))nc = c - d + abs(dr)if nr >= 0 and nr < N and nc >= 0 and nc < N:new_s.add((nr, nc))s &= new_sr, c = s.pop()print r, c