結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
ユーザー MMMM
提出日時 2024-04-19 22:10:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 923 bytes
コンパイル時間 3,836 ms
コンパイル使用メモリ 230,540 KB
実行使用メモリ 42,572 KB
最終ジャッジ日時 2024-04-19 22:10:32
合計ジャッジ時間 8,966 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 WA -
testcase_16 AC 1 ms
6,940 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 1 ms
6,940 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
#define chmin(x,y) (x) = min((x),(y))
#define chmax(x,y) (x) = max((x),(y))
#define ld long double
using namespace std;
using namespace atcoder;
using ll = long long;
const ll mod = 998244353;
using mint = modint998244353;
using Graph = vector<vector<pair<int,int>>>;
const vector<int> dx = {1,0,-1,0}, dy = {0,1,0,-1};

int main(){
  // input
  int N; cin >> N;
  vector<string> A(N);
  for(int i = 0; i < N; i++){
    cin >> A[i];
  }
  
  // prep
  vector<vector<int>> B(N,vector<int>(19,10));
  for(int i = 0; i < N; i++){
    for(int j = 0; j < A[i].size(); j++){
      int c = A[i][j] - '0';
      B[i][j] = c;
    }
  }
  sort(B.begin(),B.end());
  
  // solve
  mint ans = 0;
  for(int i = 0; i < N; i++){
    for(int j = 0; j < 19; j++){
      if(B[i][j] < 10){
        ans *= 10;
        ans += B[i][j];
      }
    }
  }
  
  // output
  cout << ans.val() << endl;
}
0