結果

問題 No.2252 Find Zero
ユーザー ああいいああいい
提出日時 2023-03-25 00:04:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 646 bytes
コンパイル時間 1,259 ms
コンパイル使用メモリ 81,344 KB
実行使用メモリ 80,336 KB
平均クエリ数 150.83
最終ジャッジ日時 2023-10-18 21:44:56
合計ジャッジ時間 4,361 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 93 ms
69,684 KB
testcase_03 AC 137 ms
80,232 KB
testcase_04 AC 114 ms
75,248 KB
testcase_05 AC 91 ms
69,692 KB
testcase_06 AC 120 ms
77,296 KB
testcase_07 AC 115 ms
75,248 KB
testcase_08 AC 119 ms
77,288 KB
testcase_09 AC 138 ms
80,232 KB
testcase_10 AC 92 ms
69,692 KB
testcase_11 AC 91 ms
69,692 KB
testcase_12 AC 91 ms
69,692 KB
testcase_13 AC 91 ms
69,692 KB
testcase_14 AC 90 ms
69,692 KB
testcase_15 WA -
testcase_16 AC 91 ms
69,692 KB
testcase_17 AC 92 ms
69,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
import sys

if N % 2 == 1:
    s = set()
    count = 0
    for i in range(N):
        if count == N // 2:break
        if i not in s:
            print("?",i,i)
            a = int(input())
            if a == i:
                print("!",a)
                exit()
            else:
                s.add(a)
                s.add(i)
                count += 1
    for i in range(N):
        if i not in s:
            print("!",i)
            exit()
            
else:
    print("? 0 0")
    a = int(input())
    now = a
    for _ in range(N // 2 - 1):
        print("?",a,now)
        now = int(input())
    print("!",now)
    
0