結果

問題 No.1149 色塗りゲーム
コンテスト
ユーザー MasKoaTS
提出日時 2023-09-18 14:34:36
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 471 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 211 ms
コンパイル使用メモリ 84,992 KB
実行使用メモリ 71,728 KB
平均クエリ数 19.82
最終ジャッジ日時 2026-03-26 12:16:14
合計ジャッジ時間 6,867 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())

if(n & 1):
    print(*[1, n // 2 + 1])
else:
    print(*[2, n // 2])

while(int(input()) not in [0, 1]):
    k, x = map(int, input().split())
    if(n & 1 and k == 1):
        m = n // 2 + 1
        print(*[1, x + (m - x) * 2])
    elif(n & 1):
        m = n // 2 + 1
        print(*[2, x + (m - x) * 2 - 1])
    elif(k == 1):
        m = n // 2
        print(*[1, x + (m - x) * 2 + 1])
    else:
        m = n // 2
        print(*[2, x + (m - x) * 2])
0