結果

問題 No.2252 Find Zero
ユーザー first_vilfirst_vil
提出日時 2023-03-24 21:25:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 81,676 KB
実行使用メモリ 78,588 KB
平均クエリ数 78.17
最終ジャッジ日時 2023-10-18 20:40:59
合計ジャッジ時間 3,298 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 89 ms
69,860 KB
testcase_03 AC 110 ms
69,860 KB
testcase_04 AC 93 ms
69,868 KB
testcase_05 AC 91 ms
69,868 KB
testcase_06 AC 91 ms
69,868 KB
testcase_07 AC 91 ms
69,868 KB
testcase_08 AC 102 ms
69,860 KB
testcase_09 AC 113 ms
75,428 KB
testcase_10 AC 88 ms
69,868 KB
testcase_11 AC 87 ms
69,868 KB
testcase_12 WA -
testcase_13 AC 87 ms
69,868 KB
testcase_14 AC 88 ms
69,868 KB
testcase_15 WA -
testcase_16 AC 88 ms
69,868 KB
testcase_17 AC 88 ms
69,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

int1 = lambda x: int(x) - 1

# input = lambda: sys.stdin.buffer.readline()
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
i1 = lambda: int1(input())
mi = lambda: map(int, input().split())
mi1 = lambda: map(int1, input().split())
li = lambda: list(mi())
li1 = lambda: list(mi1())
lli = lambda n: [li() for _ in range(n)]

INF = float("inf")
# mod = int(1e9 + 7)
mod = 998244353

n = ii()
for x in range(0, n - 1, 2):
    y = x + 1
    print("?", x, y)
    sys.stdout.flush()
    z = ii()
    if z == x:
        print("!", y)
        sys.stdout.flush()
        exit()
    if z == y:
        print("!", x)
        sys.stdout.flush()
        exit()
print(n - 1)
sys.stdout.flush()
0