結果
| 問題 |
No.2734 Addition and Multiplication in yukicoder (Hard)
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2024-04-19 22:08:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 641 ms / 5,000 ms |
| コード長 | 644 bytes |
| コンパイル時間 | 1,427 ms |
| コンパイル使用メモリ | 86,364 KB |
| 最終ジャッジ日時 | 2025-02-21 04:23:34 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
#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;
}
Nachia