結果
| 問題 | No.513 宝探し2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-05 22:37:52 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
TLE
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 623 bytes |
| 記録 | |
| コンパイル時間 | 1,625 ms |
| コンパイル使用メモリ | 80,512 KB |
| 実行使用メモリ | 109,696 KB |
| 最終ジャッジ日時 | 2026-08-14 21:19:40 |
| 合計ジャッジ時間 | 8,770 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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