結果

問題 No.1187 皇帝ペンギン
ユーザー ntudantuda
提出日時 2022-03-08 22:31:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 1,000 ms
コード長 667 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 87,564 KB
平均クエリ数 16.48
最終ジャッジ日時 2023-10-01 04:57:38
合計ジャッジ時間 8,810 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
86,528 KB
testcase_01 AC 91 ms
87,048 KB
testcase_02 AC 92 ms
87,036 KB
testcase_03 AC 90 ms
87,280 KB
testcase_04 AC 89 ms
87,564 KB
testcase_05 AC 91 ms
86,816 KB
testcase_06 AC 93 ms
87,084 KB
testcase_07 AC 91 ms
87,332 KB
testcase_08 AC 90 ms
86,828 KB
testcase_09 AC 90 ms
86,988 KB
testcase_10 AC 92 ms
87,008 KB
testcase_11 AC 93 ms
86,648 KB
testcase_12 AC 93 ms
87,184 KB
testcase_13 AC 90 ms
87,384 KB
testcase_14 AC 90 ms
86,572 KB
testcase_15 AC 93 ms
86,956 KB
testcase_16 AC 93 ms
86,412 KB
testcase_17 AC 90 ms
87,064 KB
testcase_18 AC 91 ms
86,948 KB
testcase_19 AC 90 ms
87,248 KB
testcase_20 AC 91 ms
87,064 KB
testcase_21 AC 91 ms
86,868 KB
testcase_22 AC 92 ms
87,060 KB
testcase_23 AC 92 ms
87,164 KB
testcase_24 AC 92 ms
87,356 KB
testcase_25 AC 91 ms
87,088 KB
testcase_26 AC 93 ms
87,068 KB
testcase_27 AC 92 ms
86,972 KB
testcase_28 AC 92 ms
86,836 KB
testcase_29 AC 92 ms
86,932 KB
testcase_30 AC 94 ms
86,752 KB
testcase_31 AC 95 ms
86,964 KB
testcase_32 AC 95 ms
87,132 KB
testcase_33 AC 93 ms
87,176 KB
testcase_34 AC 97 ms
87,164 KB
testcase_35 AC 93 ms
87,060 KB
testcase_36 AC 93 ms
87,304 KB
testcase_37 AC 95 ms
87,004 KB
testcase_38 AC 92 ms
87,012 KB
testcase_39 AC 92 ms
87,168 KB
testcase_40 AC 92 ms
87,048 KB
testcase_41 AC 91 ms
86,800 KB
testcase_42 AC 92 ms
87,104 KB
testcase_43 AC 88 ms
86,888 KB
testcase_44 AC 91 ms
87,328 KB
testcase_45 AC 90 ms
86,944 KB
testcase_46 AC 90 ms
87,436 KB
testcase_47 AC 91 ms
87,232 KB
testcase_48 AC 91 ms
87,236 KB
testcase_49 AC 89 ms
87,024 KB
testcase_50 AC 91 ms
86,968 KB
testcase_51 AC 95 ms
87,016 KB
testcase_52 AC 94 ms
87,212 KB
testcase_53 AC 92 ms
87,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# N = 100
# D = 3

def make_divisors(n):
    divisors = []  #必要に応じてsetにしても良いかも
    i = 1
    while i ** 2 <= n:
        if n % i == 0:
            divisors.append(i)
            if i ** 2 != n:
                divisors.append(n//i)
        i += 1
    divisors.sort()
    return divisors

def check(x):
    print("?",x)
    return input() == "safe"
    # return x < N and x % D != 0

def search(lb,d):
    ub = 1000
    while ub - lb > 1:
        mid = (ub + lb) // 2
        if check(mid):
            lb = mid
        elif check(mid+1):
            lb = mid + 1
        else:
            ub = mid
    return lb

print("!",search(0,1000))
0