結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
69,920 KB
testcase_01 AC 133 ms
78,572 KB
testcase_02 AC 89 ms
69,920 KB
testcase_03 AC 109 ms
69,920 KB
testcase_04 AC 92 ms
69,928 KB
testcase_05 AC 88 ms
69,928 KB
testcase_06 AC 87 ms
69,928 KB
testcase_07 AC 88 ms
69,928 KB
testcase_08 AC 101 ms
69,920 KB
testcase_09 AC 112 ms
75,496 KB
testcase_10 AC 88 ms
69,928 KB
testcase_11 AC 89 ms
69,928 KB
testcase_12 AC 89 ms
69,928 KB
testcase_13 AC 90 ms
69,928 KB
testcase_14 AC 93 ms
69,928 KB
testcase_15 AC 93 ms
69,928 KB
testcase_16 AC 93 ms
69,928 KB
testcase_17 AC 94 ms
69,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################


n = ni()
for i in range(n//2):
    x = i * 2
    y = (i*2+1)%n
    print("?", x, y, flush=True)
    z = ni()
    if z == x:
        print("!", y, flush=True)
        exit()
    if z == y:
        print("!", x, flush = True)
        exit()
print("!", n-1, flush=True)
0