結果
| 問題 |
No.2929 Miracle Branch
|
| コンテスト | |
| ユーザー |
noriaoki
|
| 提出日時 | 2024-10-12 16:47:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 156 ms / 2,000 ms |
| コード長 | 494 bytes |
| コンパイル時間 | 393 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 98,176 KB |
| 最終ジャッジ日時 | 2024-10-12 16:48:08 |
| 合計ジャッジ時間 | 9,508 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
x = int(input())
d = list()
for i in range(3, 2*10**5+1):
while x % i == 0:
x //= i
d.append(i)
if x%2 == 0:
x //= 2
d.append(2)
if x != 1 or len(d)==0:
d.append(x)
ans = 0
for i in range(len(d)):
ans += d[i] + 1
if ans > 2*10**5:
exit(print(-1))
print(ans)
for i in range(len(d)-1):
print(i+1, i+2)
id = len(d) + 1
for i in range(len(d)):
for j in range(d[i]):
print(i+1, id)
id += 1
print(*("b"*len(d) + "g"*(ans-len(d))))
noriaoki