結果
| 問題 | No.2734 Addition and Multiplication in yukicoder (Hard) |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2024-04-20 01:08:01 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 925 ms / 5,000 ms |
| + 300µs | |
| コード長 | 390 bytes |
| 記録 | |
| コンパイル時間 | 79 ms |
| コンパイル使用メモリ | 64,888 KB |
| 実行使用メモリ | 102,736 KB |
| 最終ジャッジ日時 | 2026-10-20 22:13:02 |
| 合計ジャッジ時間 | 20,013 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
MOD = 998244353
class T:
def __init__(self, x):
self.x = x
def __lt__(self, other):
return self.x + other.x < other.x + self.x
n = int(input())
A = [T(x) for x in input().split()]
A.sort()
pow10 = [1] * 20
for i in range(1, 20):
pow10[i] = (10 * pow10[i - 1]) % MOD
ans = 0
for a in A:
a = a.x
ans = (ans * pow10[len(a)] + int(a)) % MOD
print(ans)