結果
問題 | No.2734 Addition and Multiplication in yukicoder (Hard) |
ユーザー |
|
提出日時 | 2024-04-19 23:24:09 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 612 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 82,020 KB |
実行使用メモリ | 142,900 KB |
最終ジャッジ日時 | 2024-10-11 18:00:51 |
合計ジャッジ時間 | 9,888 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 WA * 7 |
ソースコード
n = input()num = input().split()num.sort(reverse=True)index = 9result = []max2 = 0for i in num:max2 = max(len(i), max2)a = []index = 0for i in num:p = 0m = len(i)l = 0while True:if len(i) == max2:breakif max2 - m == 1:i += str(max(i))breaki += i[p]p+= 1l += 1if p == m:p == 0a.append([i, index])index += 1a.sort(key=lambda x: (x[0]), reverse=True)for i in range(len(a)):result.append(num[a[i][1]])res = 0result.reverse()for i in result:res*= 10**len(i)res+=int(i)res%=998244353print(res)