結果
問題 |
No.253 ロウソクの長さ
|
ユーザー |
![]() |
提出日時 | 2020-06-23 22:19:02 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 449 bytes |
コンパイル時間 | 215 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 27,864 KB |
平均クエリ数 | 29.44 |
最終ジャッジ日時 | 2024-07-17 03:53:51 |
合計ジャッジ時間 | 7,515 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 36 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() l,r=10,10**9 ct=0 while r-l>1: mid=(l+r)//2 print("? "+str(max(0,mid-ct)),flush=True) ct+=1 ans=int(input()) if ans==0: print("! "+str(max(0,mid-ct)),flush=True) break elif ans==1: l=mid else: r=mid else: print("? "+str(max(0,r-ct)),flush=True) ct+=1 if ans==0: print("! "+str(max(0,r-ct)),flush=True) else: print("! "+str(max(0,l-ct)),flush=True)