結果

問題 No.2929 Miracle Branch
ユーザー hato336hato336
提出日時 2024-10-12 15:49:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 635 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 96,200 KB
最終ジャッジ日時 2024-10-12 15:50:02
合計ジャッジ時間 11,290 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,712 KB
testcase_01 WA -
testcase_02 AC 45 ms
56,960 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 46 ms
57,728 KB
testcase_29 AC 54 ms
57,600 KB
testcase_30 AC 45 ms
57,600 KB
testcase_31 AC 52 ms
57,600 KB
testcase_32 AC 46 ms
57,472 KB
testcase_33 AC 47 ms
57,856 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 45 ms
58,112 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 165 ms
95,500 KB
testcase_44 WA -
testcase_45 AC 46 ms
57,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())
if x == 1:
    print(2)
    print(1,2)
    print('b g')
    exit()
a = []
z = 0
for i in range(2,2*10**5):
    while x % i == 0:
        if i == 2:
            z += 1
        else:
            a.append(i)
        x //= i

if x != 1:
    exit(print(-1))
ans = 0

while z >= 2:
    a.append(4)
    z -= 2
if z == 1:
    a.append(2)
ans = sum(a) + len(a)
if ans > 2*10**5:
    exit(print(-1))
x = len(a)
print(ans)
cnt = len(a)
for i in range(len(a)):
    for j in range(a[i]):
        print(i+1,cnt+1)
        cnt +=1 
q = []
for i in range(len(a)):
    q.append('b')
for i in range(sum(a)):
    q.append('g')
print(*q)
0