結果
| 問題 |
No.3212 SUPER Guess the Number
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2025-07-25 22:23:14 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 559 bytes |
| コンパイル時間 | 415 ms |
| コンパイル使用メモリ | 82,376 KB |
| 実行使用メモリ | 71,548 KB |
| 平均クエリ数 | 22.00 |
| 最終ジャッジ日時 | 2025-07-25 22:23:18 |
| 合計ジャッジ時間 | 3,680 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 12 |
ソースコード
def binary_search(f):
left,right=0,10**6+1
while right-left>1:
mid=(right+left)//2
if f(mid):
left=mid
else:
right=mid
return left
a = 99999
def ask(x,x_d):
print('?', x_d)
return int(input())
if abs(a-x) >= abs(a-x_d):
print("1")
return 1
return 0
def f(x):
s_d = x-(s-x)
if s_d < 0:
s_d -= 1
else:
s_d += 1
r=ask(s,s_d)
if r == 1:
return False
return True
s = 10**6
print('?', s)
a=binary_search(f)
print('!', a)
nikoro256