結果
| 問題 |
No.2734 Addition and Multiplication in yukicoder (Hard)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-19 22:34:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 444 bytes |
| コンパイル時間 | 204 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 130,060 KB |
| 最終ジャッジ日時 | 2024-10-11 16:10:32 |
| 合計ジャッジ時間 | 20,417 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 24 |
ソースコード
from itertools import permutations
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), 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)