結果

問題 No.246 質問と回答
ユーザー MamonboMamonbo
提出日時 2015-08-03 19:40:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 24,240 KB
平均クエリ数 31.30
最終ジャッジ日時 2023-09-23 20:05:42
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
23,568 KB
testcase_01 AC 52 ms
23,352 KB
testcase_02 AC 54 ms
23,732 KB
testcase_03 AC 55 ms
24,240 KB
testcase_04 AC 55 ms
23,244 KB
testcase_05 AC 56 ms
24,060 KB
testcase_06 AC 54 ms
24,060 KB
testcase_07 AC 52 ms
23,092 KB
testcase_08 AC 55 ms
23,868 KB
testcase_09 AC 54 ms
23,376 KB
testcase_10 AC 55 ms
23,556 KB
testcase_11 AC 55 ms
23,216 KB
testcase_12 AC 55 ms
23,880 KB
testcase_13 AC 54 ms
23,820 KB
testcase_14 AC 54 ms
23,460 KB
testcase_15 AC 53 ms
24,240 KB
testcase_16 AC 54 ms
23,240 KB
testcase_17 AC 52 ms
23,288 KB
testcase_18 AC 53 ms
24,240 KB
testcase_19 AC 53 ms
23,832 KB
testcase_20 AC 55 ms
23,412 KB
testcase_21 AC 54 ms
23,460 KB
testcase_22 AC 55 ms
24,084 KB
testcase_23 AC 54 ms
24,228 KB
testcase_24 AC 55 ms
23,304 KB
testcase_25 AC 55 ms
23,396 KB
testcase_26 AC 53 ms
23,500 KB
testcase_27 AC 53 ms
24,084 KB
testcase_28 AC 55 ms
23,208 KB
testcase_29 AC 54 ms
23,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding=UTF-8
#Land of Lispの数当て(られ)ゲームが参考になるかも
import sys

ans = 1
jogen=10**9
kagen=1

for idx in range(0,100,1):
    print ("? "+str((jogen+kagen)//2))
    sys.stdout.flush()
    res = int(input())
    if res==1:
        kagen=(jogen+kagen)//2
    else:
        jogen=(jogen+kagen)//2-1

    if jogen-kagen<=1:
        break
#    print((jogen,kagen))

print("? "+str(jogen))
sys.stdout.flush()
res=int(input())
if res==1:
    ans=jogen
else:
    ans=kagen
    
print("! "+str(ans))
sys.stdout.flush()
0