結果

問題 No.1187 皇帝ペンギン
ユーザー ああいいああいい
提出日時 2021-12-28 23:37:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 48 ms / 1,000 ms
コード長 600 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 27,592 KB
平均クエリ数 16.02
最終ジャッジ日時 2024-04-10 15:56:39
合計ジャッジ時間 5,012 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
27,080 KB
testcase_01 AC 44 ms
27,208 KB
testcase_02 AC 46 ms
27,464 KB
testcase_03 AC 46 ms
27,080 KB
testcase_04 AC 42 ms
27,392 KB
testcase_05 AC 41 ms
27,464 KB
testcase_06 AC 41 ms
27,208 KB
testcase_07 AC 41 ms
27,080 KB
testcase_08 AC 41 ms
27,080 KB
testcase_09 AC 41 ms
27,336 KB
testcase_10 AC 42 ms
27,344 KB
testcase_11 AC 43 ms
26,968 KB
testcase_12 AC 42 ms
27,336 KB
testcase_13 AC 43 ms
27,336 KB
testcase_14 AC 46 ms
27,080 KB
testcase_15 AC 46 ms
27,336 KB
testcase_16 AC 43 ms
27,464 KB
testcase_17 AC 44 ms
27,592 KB
testcase_18 AC 46 ms
27,080 KB
testcase_19 AC 45 ms
27,336 KB
testcase_20 AC 44 ms
27,208 KB
testcase_21 AC 44 ms
26,960 KB
testcase_22 AC 43 ms
27,088 KB
testcase_23 AC 45 ms
27,216 KB
testcase_24 AC 46 ms
27,344 KB
testcase_25 AC 44 ms
27,088 KB
testcase_26 AC 42 ms
27,088 KB
testcase_27 AC 47 ms
27,472 KB
testcase_28 AC 48 ms
27,344 KB
testcase_29 AC 48 ms
27,088 KB
testcase_30 AC 46 ms
26,832 KB
testcase_31 AC 45 ms
27,088 KB
testcase_32 AC 44 ms
27,344 KB
testcase_33 AC 44 ms
27,088 KB
testcase_34 AC 45 ms
27,216 KB
testcase_35 AC 45 ms
27,216 KB
testcase_36 AC 44 ms
26,960 KB
testcase_37 AC 45 ms
27,088 KB
testcase_38 AC 43 ms
27,088 KB
testcase_39 AC 44 ms
27,216 KB
testcase_40 AC 45 ms
27,088 KB
testcase_41 AC 44 ms
27,224 KB
testcase_42 AC 46 ms
26,968 KB
testcase_43 AC 44 ms
27,224 KB
testcase_44 AC 43 ms
27,096 KB
testcase_45 AC 41 ms
27,480 KB
testcase_46 AC 42 ms
27,480 KB
testcase_47 AC 42 ms
27,464 KB
testcase_48 AC 42 ms
26,824 KB
testcase_49 AC 42 ms
27,336 KB
testcase_50 AC 44 ms
27,464 KB
testcase_51 AC 41 ms
27,080 KB
testcase_52 AC 45 ms
27,216 KB
testcase_53 AC 42 ms
27,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

end = 10 ** 3
start = 0
while end - start > 1:
    mid = (start + end) // 2
    print('?',mid)
    ans = input()
    if ans == 'safe':
        start = mid
    else:
        print('?',mid-1)
        ans = input()
        if ans == 'safe':
            start = mid-1
            if end - start == 2:
                end -= 1
            elif end - start == 3:
                print('?',mid + 1)
                ans = input()
                if ans == 'safe':
                    start = mid+1
                else:
                    end = mid - 1
        else:
            end = mid-1
print('!',start)
0