結果

問題 No.253 ロウソクの長さ
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-08 19:55:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 554 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 82,184 KB
実行使用メモリ 70,968 KB
平均クエリ数 66.00
最終ジャッジ日時 2024-05-04 03:20:42
合計ジャッジ時間 5,550 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
69,684 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 60 ms
69,708 KB
testcase_07 AC 61 ms
69,508 KB
testcase_08 AC 58 ms
69,980 KB
testcase_09 WA -
testcase_10 AC 58 ms
69,416 KB
testcase_11 AC 59 ms
69,492 KB
testcase_12 AC 59 ms
70,968 KB
testcase_13 AC 59 ms
70,900 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 57 ms
70,580 KB
testcase_18 AC 63 ms
69,376 KB
testcase_19 WA -
testcase_20 AC 58 ms
70,644 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 57 ms
69,752 KB
testcase_24 WA -
testcase_25 AC 59 ms
69,580 KB
testcase_26 AC 58 ms
70,124 KB
testcase_27 AC 56 ms
69,584 KB
testcase_28 AC 58 ms
70,908 KB
testcase_29 AC 57 ms
69,660 KB
testcase_30 AC 57 ms
69,488 KB
testcase_31 AC 55 ms
69,740 KB
testcase_32 AC 57 ms
70,564 KB
testcase_33 AC 57 ms
70,904 KB
testcase_34 WA -
testcase_35 AC 60 ms
70,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ok=10
ng=10**9+10

print(f'? {100}',flush=True)
f=int(input())
if f == -1:
    ok = 9
    ng = 100


    for i in range(9):
        mid=(ok+ng)
        print(f'? {mid-i}',flush=True)
        t=int(input())
        if t >= 0:
            ok = mid
        else:
            ng = mid
            
    print(f'! {ok}')


else:

    for  i in range(1,100):
        mid=(ok+ng)//2
        t= max(mid-i,0)
        print(f'? {t}',flush=True)
        t=int(input())
        if t >= 0:
            ok = mid
        else:
            ng = mid

    print(f'! {ok}')
0