結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2024-04-19 23:04:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,743 ms / 5,000 ms
コード長 503 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 127,568 KB
最終ジャッジ日時 2024-04-19 23:05:27
合計ジャッジ時間 30,840 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
54,784 KB
testcase_01 AC 45 ms
54,528 KB
testcase_02 AC 45 ms
54,784 KB
testcase_03 AC 48 ms
55,168 KB
testcase_04 AC 44 ms
54,528 KB
testcase_05 AC 46 ms
54,784 KB
testcase_06 AC 44 ms
54,784 KB
testcase_07 AC 48 ms
54,788 KB
testcase_08 AC 44 ms
55,040 KB
testcase_09 AC 45 ms
55,168 KB
testcase_10 AC 48 ms
54,528 KB
testcase_11 AC 49 ms
54,528 KB
testcase_12 AC 45 ms
54,656 KB
testcase_13 AC 46 ms
55,168 KB
testcase_14 AC 44 ms
54,400 KB
testcase_15 AC 45 ms
54,784 KB
testcase_16 AC 44 ms
55,168 KB
testcase_17 AC 1,516 ms
117,064 KB
testcase_18 AC 1,555 ms
117,428 KB
testcase_19 AC 50 ms
61,824 KB
testcase_20 AC 48 ms
61,824 KB
testcase_21 AC 50 ms
62,080 KB
testcase_22 AC 1,672 ms
127,164 KB
testcase_23 AC 1,677 ms
127,568 KB
testcase_24 AC 1,665 ms
127,012 KB
testcase_25 AC 1,676 ms
127,108 KB
testcase_26 AC 1,694 ms
127,228 KB
testcase_27 AC 1,743 ms
125,288 KB
testcase_28 AC 1,634 ms
126,920 KB
testcase_29 AC 1,688 ms
126,704 KB
testcase_30 AC 1,645 ms
118,756 KB
testcase_31 AC 1,690 ms
126,892 KB
testcase_32 AC 1,602 ms
123,868 KB
testcase_33 AC 1,191 ms
108,040 KB
testcase_34 AC 1,394 ms
113,288 KB
testcase_35 AC 778 ms
97,336 KB
testcase_36 AC 883 ms
99,964 KB
testcase_37 AC 1,210 ms
109,404 KB
testcase_38 AC 1,180 ms
108,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

based on
https://yamate11.github.io/blog/posts/2021/11-03-abc225-f-string-cards/

"""

N = list(map(int,input().split()))

A = list(input().split())

from functools import cmp_to_key

from functools import cmp_to_key

def cmp(a, b):
    X = a+b
    Y = b+a
    if X < Y:
        return -1
    elif X==Y:
        return 0
    else:
        return 1

B = list(sorted(A, key=cmp_to_key(cmp)))

ans = "".join(B)
mod = 998244353

x = 0
for c in ans:
    x *= 10
    x += int(c)
    x %= mod

print (x)
0