結果

問題 No.2753 鳩の巣原理
ユーザー hato336hato336
提出日時 2024-05-10 21:43:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,072 KB
実行使用メモリ 70,920 KB
平均クエリ数 11.00
最終ジャッジ日時 2024-05-10 21:43:26
合計ジャッジ時間 3,793 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
69,420 KB
testcase_01 AC 58 ms
70,216 KB
testcase_02 AC 58 ms
68,984 KB
testcase_03 AC 59 ms
69,896 KB
testcase_04 AC 58 ms
69,464 KB
testcase_05 AC 56 ms
69,852 KB
testcase_06 AC 58 ms
69,188 KB
testcase_07 AC 56 ms
69,644 KB
testcase_08 AC 57 ms
69,228 KB
testcase_09 AC 56 ms
70,216 KB
testcase_10 AC 59 ms
70,920 KB
testcase_11 AC 70 ms
68,676 KB
testcase_12 AC 70 ms
69,356 KB
testcase_13 AC 58 ms
70,504 KB
testcase_14 AC 58 ms
69,068 KB
testcase_15 AC 57 ms
69,500 KB
testcase_16 AC 58 ms
69,136 KB
testcase_17 AC 58 ms
70,240 KB
testcase_18 AC 59 ms
69,404 KB
testcase_19 AC 57 ms
69,508 KB
testcase_20 AC 57 ms
69,348 KB
testcase_21 AC 56 ms
70,488 KB
testcase_22 AC 58 ms
70,368 KB
testcase_23 AC 59 ms
69,332 KB
testcase_24 AC 72 ms
69,424 KB
testcase_25 AC 57 ms
70,152 KB
testcase_26 AC 58 ms
68,892 KB
testcase_27 AC 59 ms
69,808 KB
testcase_28 AC 59 ms
69,752 KB
testcase_29 AC 59 ms
69,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
cnt = []
class nibutan():
    def __init__(self):
        self.n = n
    def __len__(self):
        return self.n
    def __getitem__(self,x):
        cnt.append(0)
        print('?',x+1,flush=True)
        z = int(input())
        if z < x+1:
            return 1
        else:
            return 0
import bisect
ans = bisect.bisect_right(nibutan(),0)
while len(cnt) != 10:
    cnt.append(0)
    print('?',1,flush=True)
    z = int(input())
print('Yes',ans,ans+1,flush=True)
0