結果
| 問題 |
No.2929 Miracle Branch
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-12 15:08:40 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 399 bytes |
| コンパイル時間 | 172 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 14,080 KB |
| 最終ジャッジ日時 | 2024-10-12 15:08:58 |
| 合計ジャッジ時間 | 12,149 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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))