結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
ユーザー titiatitia
提出日時 2024-04-22 03:06:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,042 ms / 5,000 ms
コード長 419 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,328 KB
実行使用メモリ 370,880 KB
最終ジャッジ日時 2024-04-22 03:07:04
合計ジャッジ時間 35,211 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,864 KB
testcase_01 AC 50 ms
52,352 KB
testcase_02 AC 44 ms
52,352 KB
testcase_03 AC 41 ms
52,224 KB
testcase_04 AC 40 ms
52,096 KB
testcase_05 AC 40 ms
52,480 KB
testcase_06 AC 40 ms
52,352 KB
testcase_07 AC 42 ms
52,224 KB
testcase_08 AC 50 ms
52,352 KB
testcase_09 AC 40 ms
52,608 KB
testcase_10 AC 42 ms
52,080 KB
testcase_11 AC 42 ms
52,096 KB
testcase_12 AC 42 ms
52,096 KB
testcase_13 AC 40 ms
52,352 KB
testcase_14 AC 40 ms
52,224 KB
testcase_15 AC 41 ms
52,608 KB
testcase_16 AC 41 ms
52,364 KB
testcase_17 AC 1,547 ms
256,816 KB
testcase_18 AC 1,529 ms
258,676 KB
testcase_19 AC 46 ms
60,244 KB
testcase_20 AC 57 ms
60,160 KB
testcase_21 AC 48 ms
60,288 KB
testcase_22 AC 2,022 ms
370,288 KB
testcase_23 AC 2,036 ms
369,164 KB
testcase_24 AC 2,011 ms
369,156 KB
testcase_25 AC 2,042 ms
368,620 KB
testcase_26 AC 2,042 ms
369,820 KB
testcase_27 AC 1,965 ms
349,036 KB
testcase_28 AC 2,014 ms
367,120 KB
testcase_29 AC 2,012 ms
354,568 KB
testcase_30 AC 1,924 ms
307,132 KB
testcase_31 AC 1,994 ms
370,880 KB
testcase_32 AC 1,868 ms
351,492 KB
testcase_33 AC 1,309 ms
254,744 KB
testcase_34 AC 1,659 ms
287,592 KB
testcase_35 AC 867 ms
207,768 KB
testcase_36 AC 1,008 ms
211,412 KB
testcase_37 AC 1,318 ms
256,792 KB
testcase_38 AC 1,313 ms
255,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

from operator import itemgetter

mod=998244353

N=int(input())
A=input().split()

for i in range(N):
    A[i]=list(map(int,list(A[i])))

B=[]
for s in A:
    X=s[:]
    while len(X)<19:
        X+=s
    B.append((X,s))

B.sort(key=itemgetter(0))

X=[]
for _,s in B:
    X+=s


ANS=0
T=1
for i in range(len(X)):
    u=len(X)-1-i
    ANS=(ANS+X[u]*T)%mod
    T=T*10%mod

print(ANS)
0