結果
問題 |
No.2929 Miracle Branch
|
ユーザー |
![]() |
提出日時 | 2024-11-01 08:58:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 515 bytes |
コンパイル時間 | 390 ms |
コンパイル使用メモリ | 82,448 KB |
実行使用メモリ | 109,300 KB |
最終ジャッジ日時 | 2024-11-01 08:58:57 |
合計ジャッジ時間 | 12,505 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 9 WA * 34 |
ソースコード
X = int(input()) if X == 1: print(2) print(1, 2) print("b g") exit() M = 2 * 10 ** 5 L = [] for i in range(2, M + 1): while X % i == 0: L.append(i) X //= i if X != 1: print(-1) exit() now = len(L) GB = ["b"] * now ans = [] now += 1 for i in range(len(L)): for j in range(L[i]): ans.append((i + 1, now)) now += 1 GB.append("g") if len(GB) > M: print(-1) exit() print(len(GB)) for a, b in ans: print(a, b) print(*GB)