結果

問題 No.2252 Find Zero
ユーザー first_vilfirst_vil
提出日時 2023-03-24 21:26:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 78,576 KB
平均クエリ数 78.17
最終ジャッジ日時 2023-10-18 20:41:43
合計ジャッジ時間 3,131 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
69,932 KB
testcase_01 AC 131 ms
78,576 KB
testcase_02 AC 91 ms
69,932 KB
testcase_03 AC 112 ms
69,932 KB
testcase_04 AC 91 ms
69,940 KB
testcase_05 AC 89 ms
69,940 KB
testcase_06 AC 91 ms
69,940 KB
testcase_07 AC 90 ms
69,940 KB
testcase_08 AC 103 ms
69,932 KB
testcase_09 AC 112 ms
75,468 KB
testcase_10 AC 88 ms
69,940 KB
testcase_11 AC 90 ms
69,940 KB
testcase_12 AC 90 ms
69,940 KB
testcase_13 AC 88 ms
69,940 KB
testcase_14 AC 89 ms
69,940 KB
testcase_15 AC 90 ms
69,940 KB
testcase_16 AC 89 ms
69,940 KB
testcase_17 AC 93 ms
69,940 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