結果
| 問題 |
No.2929 Miracle Branch
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-12 17:25:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 161 ms / 2,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 428 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 84,032 KB |
| 最終ジャッジ日時 | 2024-10-12 17:25:51 |
| 合計ジャッジ時間 | 10,946 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
X=int(input())
g=[]
while X % 4 == 0:
g.append(4)
X //= 4
for i in range(2, 200000):
while X % i==0:
g.append(i)
X //= i
if X != 1:
print(-1)
exit()
if len(g) == 0:
g.append(1)
if sum(g) + len(g) > 200000:
print(-1)
exit()
print(sum(g) + len(g))
c=["b"] * len(g) + ["g"] * sum(g)
pos=len(g) + 1
for i in range(len(g)):
if i != 0:
print(i, i + 1)
for j in range(g[i]):
print(i + 1, pos)
pos += 1
print(*c)