結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
コンテスト
ユーザー titia
提出日時 2024-04-22 03:02:06
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 419 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 544 ms
コンパイル使用メモリ 20,840 KB
実行使用メモリ 186,968 KB
最終ジャッジ日時 2026-05-01 12:28:18
合計ジャッジ時間 55,085 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

from operator import itemgetter

mod=998244353

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

A=list(map(str,A))

B=[]
for s in A:
    X=list(s)
    while len(X)<20:
        X+=list(s)
    B.append((X,list(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+int(X[u])*T)%mod
    T=T*10%mod

print(ANS)
0