結果

問題 No.2729 Addition and Multiplication in yukicoder (Easy)
ユーザー 🦠みどりむし🦠みどりむし
提出日時 2024-04-04 22:50:57
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 1,198 ms
コンパイル使用メモリ 104,284 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-04 22:51:02
合計ジャッジ時間 4,932 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 152 ms
6,676 KB
testcase_03 AC 79 ms
6,676 KB
testcase_04 AC 85 ms
6,676 KB
testcase_05 AC 91 ms
6,676 KB
testcase_06 AC 156 ms
6,676 KB
testcase_07 AC 111 ms
6,676 KB
testcase_08 AC 147 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 156 ms
6,676 KB
testcase_13 AC 155 ms
6,676 KB
testcase_14 AC 171 ms
6,676 KB
testcase_15 AC 155 ms
6,676 KB
testcase_16 AC 104 ms
6,676 KB
testcase_17 AC 110 ms
6,676 KB
testcase_18 AC 134 ms
6,676 KB
testcase_19 AC 105 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

signed main() {
    int n; std::cin >> n;
    std::vector<long> a(n); for(auto& v : a) std::cin >> v;

    std::ranges::sort(a);

    long ans = 0;
    for(const long v : a) {
        ans *= 10;
        ans %= 998244353;

        ans += v;
        ans %= 998244353;
    }

    std::cout << ans << "\n";
}
0