結果

問題 No.2252 Find Zero
ユーザー ShirotsumeShirotsume
提出日時 2023-03-24 21:49:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 81,780 KB
実行使用メモリ 80,672 KB
平均クエリ数 78.17
最終ジャッジ日時 2023-10-18 20:58:26
合計ジャッジ時間 3,377 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
72,012 KB
testcase_01 AC 142 ms
80,672 KB
testcase_02 AC 96 ms
72,012 KB
testcase_03 AC 115 ms
72,012 KB
testcase_04 AC 99 ms
72,020 KB
testcase_05 AC 95 ms
72,020 KB
testcase_06 AC 96 ms
72,020 KB
testcase_07 AC 99 ms
72,020 KB
testcase_08 AC 109 ms
72,012 KB
testcase_09 AC 120 ms
77,556 KB
testcase_10 AC 97 ms
72,020 KB
testcase_11 AC 96 ms
72,020 KB
testcase_12 AC 93 ms
72,020 KB
testcase_13 AC 97 ms
72,020 KB
testcase_14 AC 96 ms
72,020 KB
testcase_15 AC 95 ms
72,020 KB
testcase_16 AC 96 ms
72,020 KB
testcase_17 AC 95 ms
72,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

def query(x, y):
    print('?', x, y, flush=True)
    return ii()

def answer(z):
    print('!', z, flush=True)
    exit()


n = ii()

for i in range(0, n - 1, 2):
    z = query(i, i + 1)
    if z == i:
        answer(i + 1)
    elif z == i + 1:
        answer(i)
answer(n - 1)
0