c633. 基礎排序 #2-2 ( 質因數和 )
Tags : sort 建表 質因數
Accepted rate : 42人/63人 ( 67% ) [非即時]
評分方式:
Tolerant

最近更新 : 2024-05-06 14:13

Content

測資中有若干行字串 S

S 為大小寫字母及數字的混和。

例: 

S1 = dMB1WA2rjoiy8 , 可取出文字字串 T = dMBWArjoiy , 數字 N = 128 , N 的質因數和為 2 

S2 = dMB1WA2rjoiy6 , 可取出文字字串 T = dMBWArjoiy , 數字 N = 126 , N 的質因數和為 12 (2,3,7) 

請將測資中的字串排序後輸出。

規則如下:

1)  依質因數和遞減排序。

2)  質因數和相同則對 T 做遞增排序。

3)  T 也相同則對 N 做遞減排序。

 

 

Input

 

Output
Sample Input #1
dMB1WA2rjoiy8
dMB1WA2rjoiy6
Sample Output #1
dMB1WA2rjoiy6
dMB1WA2rjoiy8
測資資訊:
記憶體限制: 512 MB
公開 測資點#0 (25%): 0.5s , <1M
公開 測資點#1 (25%): 0.5s , <1M
公開 測資點#2 (25%): 2.0s , <10M
公開 測資點#3 (25%): 3.0s , <10M
Hint :

測資 0 :  1 < N < 10000

測資 1 :  1 < N < 100000

測資 2 :  1 < N < 1000000

測資 3 = 測資 2

 

Tags:
sort 建表 質因數
出處:
it's david [管理者: asnewchien@g ... (david) ]

Status Forum 排行

ID User Problem Subject Hit Post Date
14073 asnewchien@g ... (david) c633
__参考
1217 2018-06-09 00:55