結果
| 問題 | 
                            No.1149 色塗りゲーム
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-10-12 04:45:45 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 185 ms / 2,000 ms | 
| コード長 | 529 bytes | 
| コンパイル時間 | 306 ms | 
| コンパイル使用メモリ | 81,948 KB | 
| 実行使用メモリ | 70,500 KB | 
| 平均クエリ数 | 19.82 | 
| 最終ジャッジ日時 | 2024-07-17 07:06:57 | 
| 合計ジャッジ時間 | 8,866 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 50 | 
ソースコード
import sys
readline = sys.stdin.readline
write = sys.stdout.write
flush = sys.stdout.flush
# クエリ: "? x1 x2" を出力
def query(x1, x2):
    write("%d %d\n" % (x1, x2))
    flush()
    # ジャッジから返される値を取得
    return readline().strip()
# 回答: "! x" を出力
def answer(x):
    write("%d\n" % x)
    flush()
    # 即時終了
    exit(0)
N = int(input())
if N%2==1:
  s = query(1,(N+1)//2)
else:
  s = query(2,N//2)
while s=='3':
  a, b = map(int, input().split())
  s = query(a,N+1-b-(a-1))