結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
ユーザー 👑 rin204rin204
提出日時 2024-04-20 01:08:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,461 ms / 5,000 ms
コード長 390 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 117,112 KB
最終ジャッジ日時 2024-04-20 01:08:29
合計ジャッジ時間 23,692 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,220 KB
testcase_01 AC 36 ms
53,960 KB
testcase_02 AC 35 ms
52,996 KB
testcase_03 AC 36 ms
52,744 KB
testcase_04 AC 34 ms
51,880 KB
testcase_05 AC 35 ms
53,376 KB
testcase_06 AC 34 ms
52,304 KB
testcase_07 AC 36 ms
52,004 KB
testcase_08 AC 36 ms
52,460 KB
testcase_09 AC 35 ms
52,772 KB
testcase_10 AC 35 ms
52,340 KB
testcase_11 AC 35 ms
52,432 KB
testcase_12 AC 36 ms
53,000 KB
testcase_13 AC 35 ms
52,408 KB
testcase_14 AC 35 ms
53,716 KB
testcase_15 AC 45 ms
53,072 KB
testcase_16 AC 35 ms
52,544 KB
testcase_17 AC 1,164 ms
105,500 KB
testcase_18 AC 1,180 ms
106,272 KB
testcase_19 AC 35 ms
53,644 KB
testcase_20 AC 35 ms
54,356 KB
testcase_21 AC 34 ms
52,516 KB
testcase_22 AC 1,257 ms
117,112 KB
testcase_23 AC 1,230 ms
116,828 KB
testcase_24 AC 1,254 ms
117,088 KB
testcase_25 AC 1,258 ms
116,724 KB
testcase_26 AC 1,264 ms
117,092 KB
testcase_27 AC 1,239 ms
112,888 KB
testcase_28 AC 1,461 ms
116,508 KB
testcase_29 AC 1,248 ms
115,320 KB
testcase_30 AC 1,242 ms
107,972 KB
testcase_31 AC 1,286 ms
115,872 KB
testcase_32 AC 1,159 ms
111,952 KB
testcase_33 AC 909 ms
100,824 KB
testcase_34 AC 1,057 ms
103,520 KB
testcase_35 AC 596 ms
97,728 KB
testcase_36 AC 687 ms
98,680 KB
testcase_37 AC 889 ms
100,328 KB
testcase_38 AC 955 ms
100,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0