結果
問題 |
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 sys import random N = 100001 print 0, 0 sys.stdout.flush() d = int(raw_input()) s = set() for r in xrange(N): c = d - r if c < 0: continue s.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 + dr nc = 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_s r, c = s.pop() print r, c