結果

問題 No.2753 鳩の巣原理
ユーザー pitPpitP
提出日時 2024-05-10 22:50:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 82,252 KB
実行使用メモリ 70,436 KB
平均クエリ数 11.00
最終ジャッジ日時 2024-05-10 22:50:37
合計ジャッジ時間 3,462 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
68,792 KB
testcase_01 AC 53 ms
70,388 KB
testcase_02 AC 60 ms
69,732 KB
testcase_03 AC 53 ms
69,104 KB
testcase_04 AC 55 ms
69,108 KB
testcase_05 AC 52 ms
69,288 KB
testcase_06 AC 54 ms
68,468 KB
testcase_07 AC 53 ms
68,752 KB
testcase_08 AC 55 ms
69,404 KB
testcase_09 AC 55 ms
69,512 KB
testcase_10 AC 55 ms
69,960 KB
testcase_11 AC 60 ms
68,984 KB
testcase_12 AC 56 ms
70,436 KB
testcase_13 AC 52 ms
69,420 KB
testcase_14 AC 54 ms
68,948 KB
testcase_15 AC 61 ms
69,032 KB
testcase_16 AC 54 ms
68,480 KB
testcase_17 AC 52 ms
69,264 KB
testcase_18 AC 52 ms
68,364 KB
testcase_19 AC 52 ms
69,144 KB
testcase_20 AC 54 ms
69,444 KB
testcase_21 AC 55 ms
69,860 KB
testcase_22 AC 53 ms
68,852 KB
testcase_23 AC 52 ms
69,184 KB
testcase_24 AC 53 ms
70,092 KB
testcase_25 AC 54 ms
69,036 KB
testcase_26 AC 52 ms
68,636 KB
testcase_27 AC 55 ms
69,000 KB
testcase_28 AC 61 ms
69,172 KB
testcase_29 AC 52 ms
69,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
left = 1
right = N

for q in range(10):
    if right - left == 1:
        print("?", 1)
        x = int(input())
        continue

    mid = (left + right) >> 1
    print("?", mid)
    x = int(input())

    if x >= mid:
        left = mid
    else:
        right = mid

print("Yes", left, right)
0