結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
ユーザー cled0328cled0328
提出日時 2024-04-19 22:45:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 733 bytes
コンパイル時間 2,628 ms
コンパイル使用メモリ 213,848 KB
実行使用メモリ 19,152 KB
最終ジャッジ日時 2024-04-19 22:46:06
合計ジャッジ時間 7,990 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 191 ms
18,796 KB
testcase_18 AC 181 ms
18,908 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 231 ms
18,808 KB
testcase_28 AC 242 ms
18,816 KB
testcase_29 AC 238 ms
18,816 KB
testcase_30 AC 217 ms
19,072 KB
testcase_31 AC 259 ms
18,924 KB
testcase_32 AC 221 ms
17,916 KB
testcase_33 AC 152 ms
14,976 KB
testcase_34 AC 187 ms
16,640 KB
testcase_35 AC 102 ms
11,648 KB
testcase_36 AC 110 ms
12,516 KB
testcase_37 AC 168 ms
15,000 KB
testcase_38 AC 170 ms
15,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using namespace atcoder;
using mint=modint998244353;

int main(){
    int n;cin>>n;
    vector<long long> a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    vector<pair<string,long long>> srt(n);
    for(int i=0;i<n;i++){
        srt[i]={to_string(a[i]),a[i]};
        while(srt[i].first.length()<18)srt[i].first=srt[i].first+to_string(a[i]);
        srt[i].first=srt[i].first.substr(0,18);
    }
    sort(srt.begin(),srt.end());
    mint ans=0;
    vector<mint> pw(20);
    pw[0]=1;
    for(int i=0;i<19;i++)pw[i+1]=pw[i]*10;
    for(int i=0;i<n;i++){
        ans*=pw[to_string(srt[i].second).length()];
        ans+=srt[i].second;
    }
    cout<<ans.val()<<"\n";
}
0