結果
| 問題 | No.2929 Miracle Branch |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-12 15:08:40 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 399 bytes |
| 記録 | |
| コンパイル時間 | 827 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 18,388 KB |
| 最終ジャッジ日時 | 2026-04-29 16:07:21 |
| 合計ジャッジ時間 | 14,125 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 8 WA * 35 |
ソースコード
n=int(input())
a=[]
while n%4==0:
a.append(4)
n//=4
while n%6==0:
a.append(6)
n//=6
for i in range(2,200000):
while n%i==0:
a.append(i)
n//=i
if sum(a)+len(a)>=200000 or n!=1:
print(-1)
elif n==1 and len(a)==0:
print("""2
1 2
b g""")
else:
print(sum(a)+len(a))
nt=0
for i in range(len(a)):
for j in range(a[i]):
print(i+1,len(a)+nt+1)
nt+=1
print(*["b"]*len(a),*["g"]*sum(a))