結果

問題 No.2753 鳩の巣原理
ユーザー hato336
提出日時 2024-05-10 21:43:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 71,488 KB
平均クエリ数 11.00
最終ジャッジ日時 2024-12-20 04:51:35
合計ジャッジ時間 3,970 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

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