結果

問題 No.2252 Find Zero
ユーザー ああいいああいい
提出日時 2023-03-25 17:01:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 504 bytes
コンパイル時間 686 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 80,516 KB
平均クエリ数 118.11
最終ジャッジ日時 2023-10-19 03:08:36
合計ジャッジ時間 3,648 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
69,924 KB
testcase_01 AC 128 ms
75,484 KB
testcase_02 AC 103 ms
69,924 KB
testcase_03 AC 124 ms
75,484 KB
testcase_04 AC 123 ms
75,492 KB
testcase_05 WA -
testcase_06 AC 128 ms
77,540 KB
testcase_07 AC 123 ms
75,492 KB
testcase_08 AC 114 ms
69,924 KB
testcase_09 AC 149 ms
80,516 KB
testcase_10 AC 98 ms
69,932 KB
testcase_11 AC 98 ms
69,932 KB
testcase_12 AC 98 ms
69,932 KB
testcase_13 AC 100 ms
69,932 KB
testcase_14 AC 98 ms
69,932 KB
testcase_15 AC 97 ms
69,932 KB
testcase_16 AC 99 ms
69,932 KB
testcase_17 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
import sys

if N % 2 == 1:
    s = set()
    count = 0

    for i in range(0,N // 2,2):
        print("?",i,i + 1)
        a = int(input())
        if a == i:
            print("!",i + 1)
            exit()
        if a == i + 1:
            print("!",i)
            exit()
            
    print("!",N - 1)
            
else:
    print("? 0 0")
    a = int(input())
    now = a
    for _ in range(N // 2 - 1):
        print("?",a,now)
        now = int(input())
    print("!",now)
    
0