結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
ユーザー GGanariGGanari
提出日時 2024-04-20 00:04:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 874 bytes
コンパイル時間 2,921 ms
コンパイル使用メモリ 207,704 KB
実行使用メモリ 17,764 KB
最終ジャッジ日時 2024-04-20 00:04:48
合計ジャッジ時間 7,940 ms
ジャッジサーバーID
(参考情報)
judge2 / 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 2 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 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 177 ms
17,632 KB
testcase_18 AC 206 ms
17,504 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 229 ms
17,700 KB
testcase_28 AC 217 ms
17,508 KB
testcase_29 AC 218 ms
17,636 KB
testcase_30 AC 202 ms
17,636 KB
testcase_31 AC 215 ms
17,508 KB
testcase_32 AC 222 ms
17,632 KB
testcase_33 AC 145 ms
17,632 KB
testcase_34 AC 176 ms
17,508 KB
testcase_35 AC 95 ms
10,596 KB
testcase_36 AC 122 ms
11,368 KB
testcase_37 AC 160 ms
17,636 KB
testcase_38 AC 151 ms
17,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define INF 1000000001LL
#define LNF 1000000000000000001LL
#define MOD 998244353LL
#define MAX 1005
#define long long long
#define all(x) x.begin(),x.end()
using namespace std;


int main()
{
	ios_base::sync_with_stdio(0); 
    cin.tie(0);
    
    
    int n;
    cin >> n;

    vector<pair<string,long>> arr;

    for(int i = 0; i<n; i++)
    {
        long x;
        cin >> x;
        string s;
        string strX = to_string(x);
        for(int j = 0; j < 20; j++)
            s.push_back(strX[j%strX.size()]);
        arr.push_back({s,x});
    }
    sort(all(arr));
    long res = 0;
    for(int i = 0; i<n; i++)
    {
        long x = arr[i].second;
        while(x)
        {
            res*=10;
            res%=MOD;
            x/=10;
        }
        res+=arr[i].second;
        res%=MOD;
    }
    cout << res << endl;
    return 0;
}
0