結果
| 問題 |
No.513 宝探し2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-05 22:37:13 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 650 bytes |
| コンパイル時間 | 1,633 ms |
| コンパイル使用メモリ | 76,716 KB |
| 実行使用メモリ | 128,672 KB |
| 平均クエリ数 | 2.92 |
| 最終ジャッジ日時 | 2024-07-16 12:57:03 |
| 合計ジャッジ時間 | 7,719 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 RE * 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:
print s
r, c = random.sample(s, 1)[0]
print r, c
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