結果

問題 No.2252 Find Zero
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-03-24 21:36:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 81,616 KB
実行使用メモリ 80,440 KB
平均クエリ数 78.17
最終ジャッジ日時 2023-10-18 20:51:53
合計ジャッジ時間 3,250 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
69,924 KB
testcase_01 AC 143 ms
80,440 KB
testcase_02 AC 94 ms
69,924 KB
testcase_03 AC 118 ms
75,408 KB
testcase_04 AC 96 ms
69,932 KB
testcase_05 AC 94 ms
69,932 KB
testcase_06 AC 94 ms
69,932 KB
testcase_07 AC 95 ms
69,932 KB
testcase_08 AC 108 ms
69,924 KB
testcase_09 AC 118 ms
75,408 KB
testcase_10 AC 92 ms
69,932 KB
testcase_11 AC 93 ms
69,932 KB
testcase_12 AC 93 ms
69,932 KB
testcase_13 AC 92 ms
69,932 KB
testcase_14 AC 94 ms
69,932 KB
testcase_15 AC 93 ms
69,932 KB
testcase_16 AC 94 ms
69,932 KB
testcase_17 AC 93 ms
69,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

n = int(input())

for i in range(n//2):
    x,y = 2*i,2*i+1
    print("?",x,y)
    sys.stdout.flush()

    z = int(input())
    if z == x:
        print("!",y)
        sys.stdout.flush()
        exit()
    if z == y:
        print("!",x)
        sys.stdout.flush()
        exit()
print("!",n-1)
sys.stdout.flush()

exit()
0