結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
ユーザー 👑 NachiaNachia
提出日時 2024-04-19 22:08:57
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 542 ms / 5,000 ms
コード長 644 bytes
コンパイル時間 1,014 ms
コンパイル使用メモリ 90,188 KB
実行使用メモリ 19,708 KB
最終ジャッジ日時 2024-04-19 22:09:12
合計ジャッジ時間 9,668 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 242 ms
10,312 KB
testcase_18 AC 239 ms
10,112 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 502 ms
19,456 KB
testcase_23 AC 478 ms
19,584 KB
testcase_24 AC 490 ms
19,708 KB
testcase_25 AC 542 ms
19,584 KB
testcase_26 AC 481 ms
19,576 KB
testcase_27 AC 432 ms
16,768 KB
testcase_28 AC 517 ms
18,772 KB
testcase_29 AC 492 ms
18,304 KB
testcase_30 AC 387 ms
15,232 KB
testcase_31 AC 481 ms
19,260 KB
testcase_32 AC 468 ms
17,516 KB
testcase_33 AC 259 ms
11,520 KB
testcase_34 AC 355 ms
14,464 KB
testcase_35 AC 159 ms
8,192 KB
testcase_36 AC 167 ms
8,576 KB
testcase_37 AC 335 ms
13,080 KB
testcase_38 AC 283 ms
11,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <atcoder/modint>
#define rep(i,n) for(int i=0; i<int(n); i++)
using i64 = long long;
using Modint = atcoder::static_modint<998244353>;
using namespace std;


int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N; cin >> N;
    vector<string> A(N);
    vector<int> B(N);
    rep(i,N) cin >> A[i];
    sort(A.begin(), A.end(), [&](const string& l, const string& r){ return l+r < r+l; });
    Modint ans = 0;
    for(string s : A) for(char c : s) ans = ans * 10 + (c - '0');
    cout << ans.val() << endl;
    return 0;
}
0