結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
ユーザー pitPpitP
提出日時 2024-04-19 23:15:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,618 ms / 5,000 ms
コード長 369 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 138,012 KB
最終ジャッジ日時 2024-04-19 23:16:19
合計ジャッジ時間 28,728 ms
ジャッジサーバーID
(参考情報)
judge3 / judge6
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
55,676 KB
testcase_01 AC 38 ms
56,044 KB
testcase_02 AC 38 ms
55,808 KB
testcase_03 AC 39 ms
56,020 KB
testcase_04 AC 54 ms
55,664 KB
testcase_05 AC 40 ms
55,052 KB
testcase_06 AC 37 ms
55,164 KB
testcase_07 AC 39 ms
55,700 KB
testcase_08 AC 38 ms
56,168 KB
testcase_09 AC 37 ms
55,764 KB
testcase_10 AC 37 ms
55,416 KB
testcase_11 AC 37 ms
55,124 KB
testcase_12 AC 39 ms
55,480 KB
testcase_13 AC 39 ms
54,788 KB
testcase_14 AC 39 ms
56,428 KB
testcase_15 AC 38 ms
55,088 KB
testcase_16 AC 38 ms
54,576 KB
testcase_17 AC 1,408 ms
119,568 KB
testcase_18 AC 1,455 ms
128,524 KB
testcase_19 AC 40 ms
56,296 KB
testcase_20 AC 39 ms
55,504 KB
testcase_21 AC 38 ms
57,060 KB
testcase_22 AC 1,618 ms
137,760 KB
testcase_23 AC 1,554 ms
137,676 KB
testcase_24 AC 1,553 ms
137,792 KB
testcase_25 AC 1,555 ms
137,832 KB
testcase_26 AC 1,595 ms
138,012 KB
testcase_27 AC 1,512 ms
135,680 KB
testcase_28 AC 1,572 ms
137,732 KB
testcase_29 AC 1,526 ms
137,148 KB
testcase_30 AC 1,522 ms
134,708 KB
testcase_31 AC 1,546 ms
137,468 KB
testcase_32 AC 1,449 ms
134,156 KB
testcase_33 AC 1,114 ms
118,444 KB
testcase_34 AC 1,283 ms
127,380 KB
testcase_35 AC 729 ms
99,768 KB
testcase_36 AC 814 ms
102,380 KB
testcase_37 AC 1,110 ms
118,440 KB
testcase_38 AC 1,075 ms
117,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import cmp_to_key
MOD = 998244353
N = int(input())
A = list(map(int, input().split()))
B = []


B = [(str(A[i]), i) for i in range(N)]
def cmp(x, y):
    S = x[0]; T = y[0]
    return -1 if S + T < T + S else 0

B.sort(key=cmp_to_key(cmp))

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