結果
問題 |
No.1149 色塗りゲーム
|
ユーザー |
|
提出日時 | 2022-02-16 22:29:54 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 178 ms / 2,000 ms |
コード長 | 592 bytes |
コンパイル時間 | 89 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 27,616 KB |
平均クエリ数 | 19.82 |
最終ジャッジ日時 | 2024-06-29 07:19:55 |
合計ジャッジ時間 | 8,491 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
ソースコード
n = int(input()) if n == 1: print(1, 1) elif n == 2: print(2, 1) else: if n % 2 == 0: print(2, n // 2) l, r = n // 2 - 1, n // 2 + 2 else: print(1, (n + 1) // 2) l, r = (n + 1) // 2 - 1, (n + 1) // 2 + 1 t = int(input()) while t == 3: k, x = map(int, input().split()) if x <= l: if k == 2: x += 1 dif = l - x print(k, r + dif) else: if k == 2: x += 1 dif = x - r print(k, l - dif) t = int(input())