結果
| 問題 | 
                            No.2753 鳩の巣原理
                             | 
                    
| コンテスト | |
| ユーザー | 
                             norioc
                         | 
                    
| 提出日時 | 2025-03-27 07:34:43 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 402 bytes | 
| コンパイル時間 | 857 ms | 
| コンパイル使用メモリ | 82,440 KB | 
| 実行使用メモリ | 71,384 KB | 
| 平均クエリ数 | 11.00 | 
| 最終ジャッジ日時 | 2025-03-27 07:34:52 | 
| 合計ジャッジ時間 | 6,300 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 25 WA * 5 | 
ソースコード
def query(i):
    print(f'? {i}')
    res = int(input())
    return res
N = int(input())
lo = 1
hi = N
d = {}
ans = None
for _ in range(10):
    m = (lo + hi) // 2
    res = query(m)
    if res in d:
        ans = sorted([m, d[res]])
        continue
    d[res] = m
    if res < m:
        hi = m
    else:
        lo = m
if ans is None:
    print('No')
    exit()
print(f'Yes {ans[0]} {ans[1]}')
            
            
            
        
            
norioc