結果

問題 No.2729 Addition and Multiplication in yukicoder (Easy)
ユーザー AngrySadEightAngrySadEight
提出日時 2024-03-12 01:44:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 4,565 ms
コンパイル使用メモリ 79,684 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-12 01:44:21
合計ジャッジ時間 5,323 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 149 ms
6,676 KB
testcase_03 AC 82 ms
6,676 KB
testcase_04 AC 88 ms
6,676 KB
testcase_05 AC 94 ms
6,676 KB
testcase_06 AC 157 ms
6,676 KB
testcase_07 AC 114 ms
6,676 KB
testcase_08 AC 149 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 157 ms
6,676 KB
testcase_13 AC 158 ms
6,676 KB
testcase_14 AC 156 ms
6,676 KB
testcase_15 AC 156 ms
6,676 KB
testcase_16 AC 107 ms
6,676 KB
testcase_17 AC 108 ms
6,676 KB
testcase_18 AC 135 ms
6,676 KB
testcase_19 AC 107 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

ll mod = 998244353;

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.begin(), A.end());
    ll x = 0;
    for (ll i = 0; i < N; i++) {
        x = (x * 10LL) % mod;
        x = (x + (A[i] % mod)) % mod;
    }
    cout << x << endl;
}
0