結果
| 問題 |
No.2734 Addition and Multiplication in yukicoder (Hard)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-19 22:39:39 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 420 bytes |
| コンパイル時間 | 278 ms |
| コンパイル使用メモリ | 82,476 KB |
| 実行使用メモリ | 139,736 KB |
| 最終ジャッジ日時 | 2024-10-11 16:23:56 |
| 合計ジャッジ時間 | 23,054 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 21 |
ソースコード
MOD = 998244353
N = int(input())
A = list(map(int, input().split()))
B = []
for i in range(N):
sA = str(A[i])
S = []
for j in range(20):
if len(sA) <= j:
S.append(S[-1])
else:
S.append(sA[j])
B.append(("".join(S), -len(sA), i))
B.sort()
x = 0
for i in range(N):
idx = B[i][-1]
x = pow(10, len(str(A[idx]))) * x + A[idx]
x %= MOD
print(x)
# print(B)