結果
| 問題 |
No.2929 Miracle Branch
|
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2024-10-12 16:28:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 161 ms / 2,000 ms |
| コード長 | 490 bytes |
| コンパイル時間 | 170 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 85,712 KB |
| 最終ジャッジ日時 | 2024-10-12 16:28:28 |
| 合計ジャッジ時間 | 9,799 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
n=int(input())
if n==1:
print(2)
print(1,2)
print("b","g")
X=2*10**5
f=[]
for i in range(2,X):
if n%i==0:
while n%i==0:
n//=i
if len(f)>0 and f[-1]==2 and i==2:
f.pop()
f+=[4]
else:
f+=[i]
if n>1:
f+=[n]
if len(f)+sum(f)>X:
print(-1)
exit()
print(len(f)+sum(f))
for i in range(len(f)-1):
print(i+1,i+1+1)
c=len(f)
for i in range(len(f)):
for j in range(f[i]):
print(i+1,c+j+1)
c+=f[i]
print(*(["b"]*len(f)+["g"]*sum(f)))
sasa8uyauya