結果

問題 No.1187 皇帝ペンギン
ユーザー KudeKude
提出日時 2020-08-28 00:37:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 1,000 ms
コード長 302 bytes
コンパイル時間 919 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 87,604 KB
平均クエリ数 17.19
最終ジャッジ日時 2023-09-24 06:31:04
合計ジャッジ時間 8,591 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
86,768 KB
testcase_01 AC 97 ms
87,468 KB
testcase_02 AC 97 ms
86,920 KB
testcase_03 AC 98 ms
86,988 KB
testcase_04 AC 97 ms
87,036 KB
testcase_05 AC 97 ms
87,468 KB
testcase_06 AC 96 ms
86,964 KB
testcase_07 AC 98 ms
87,600 KB
testcase_08 AC 96 ms
87,212 KB
testcase_09 AC 97 ms
87,248 KB
testcase_10 AC 97 ms
87,304 KB
testcase_11 AC 95 ms
87,084 KB
testcase_12 AC 98 ms
86,852 KB
testcase_13 AC 97 ms
87,348 KB
testcase_14 AC 97 ms
87,536 KB
testcase_15 AC 96 ms
87,008 KB
testcase_16 AC 95 ms
87,060 KB
testcase_17 AC 99 ms
86,628 KB
testcase_18 AC 96 ms
87,236 KB
testcase_19 AC 96 ms
87,008 KB
testcase_20 AC 95 ms
87,256 KB
testcase_21 AC 98 ms
86,956 KB
testcase_22 AC 98 ms
87,296 KB
testcase_23 AC 96 ms
87,236 KB
testcase_24 AC 96 ms
87,600 KB
testcase_25 AC 97 ms
86,892 KB
testcase_26 AC 97 ms
87,436 KB
testcase_27 AC 98 ms
87,604 KB
testcase_28 AC 97 ms
87,488 KB
testcase_29 AC 96 ms
87,332 KB
testcase_30 AC 97 ms
87,548 KB
testcase_31 AC 97 ms
87,360 KB
testcase_32 AC 98 ms
87,196 KB
testcase_33 AC 99 ms
87,156 KB
testcase_34 AC 100 ms
87,308 KB
testcase_35 AC 99 ms
87,408 KB
testcase_36 AC 98 ms
87,492 KB
testcase_37 AC 98 ms
87,484 KB
testcase_38 AC 100 ms
86,944 KB
testcase_39 AC 100 ms
87,236 KB
testcase_40 AC 100 ms
86,736 KB
testcase_41 AC 99 ms
87,196 KB
testcase_42 AC 97 ms
87,208 KB
testcase_43 AC 99 ms
87,244 KB
testcase_44 AC 99 ms
86,924 KB
testcase_45 AC 97 ms
87,320 KB
testcase_46 AC 97 ms
87,296 KB
testcase_47 AC 97 ms
87,112 KB
testcase_48 AC 99 ms
86,688 KB
testcase_49 AC 99 ms
87,336 KB
testcase_50 AC 98 ms
87,536 KB
testcase_51 AC 98 ms
87,028 KB
testcase_52 AC 96 ms
87,460 KB
testcase_53 AC 98 ms
87,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def q(x):
    print('?', x)
    return input() == 'safe'

def ans(x):
    print('!', x)
    return

if not q(1):
    ans(0)
    exit()
l = 1
r = 1000
while r - l > 1:
    c = (r + l) // 2
    if q(c):
        l = c
    else:
        if q(c+1):
            l = c+1
        else:
            r = c
ans(l)
0