結果
| 問題 |
No.2734 Addition and Multiplication in yukicoder (Hard)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-14 15:09:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 3,588 ms / 5,000 ms |
| コード長 | 250 bytes |
| コンパイル時間 | 256 ms |
| コンパイル使用メモリ | 82,420 KB |
| 実行使用メモリ | 135,448 KB |
| 最終ジャッジ日時 | 2024-10-03 14:42:00 |
| 合計ジャッジ時間 | 61,737 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
from fractions import Fraction N = int(input()) A = list(map(int, input().split())) B = [(Fraction(i, 10 ** len(str(i)) - 1), i) for i in A] B.sort() ans = 0 mod = 998244353 for _, i in B: ans = (pow(10, len(str(i)), mod) * ans + i) % mod print(ans)