結果

問題 No.2729 Addition and Multiplication in yukicoder (Easy)
ユーザー Ekiben542Ekiben542
提出日時 2024-04-19 21:29:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 111,368 KB
最終ジャッジ日時 2024-04-19 21:29:46
合計ジャッジ時間 4,009 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,224 KB
testcase_01 AC 34 ms
51,328 KB
testcase_02 AC 127 ms
111,368 KB
testcase_03 AC 113 ms
105,344 KB
testcase_04 AC 134 ms
106,368 KB
testcase_05 AC 116 ms
108,288 KB
testcase_06 AC 130 ms
108,016 KB
testcase_07 AC 149 ms
101,648 KB
testcase_08 AC 120 ms
107,448 KB
testcase_09 AC 33 ms
51,584 KB
testcase_10 AC 34 ms
51,840 KB
testcase_11 AC 34 ms
52,224 KB
testcase_12 AC 129 ms
108,016 KB
testcase_13 AC 132 ms
108,268 KB
testcase_14 AC 130 ms
107,888 KB
testcase_15 AC 129 ms
107,760 KB
testcase_16 AC 108 ms
97,408 KB
testcase_17 AC 105 ms
97,664 KB
testcase_18 AC 121 ms
102,876 KB
testcase_19 AC 109 ms
97,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

def min_possible_value(N, A):
    A.sort()
    dp = [0] * (N + 1)
    dp[0] = 0
    
    for i in range(1, N + 1):
        dp[i] = (10 * dp[i - 1] + A[i - 1]) % MOD
    
    return dp[N]
N = int(input())
A = list(map(int, input().split()))
result = min_possible_value(N, A)
print(result)
0