結果
問題 | No.2734 Addition and Multiplication in yukicoder (Hard) |
ユーザー |
|
提出日時 | 2024-09-17 00:34:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 565 ms / 5,000 ms |
コード長 | 599 bytes |
コンパイル時間 | 2,159 ms |
コンパイル使用メモリ | 205,152 KB |
最終ジャッジ日時 | 2025-02-24 09:00:14 |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i,n) for(ll i=0;i<n;i++)using ll = long long;#include<atcoder/modint>using namespace atcoder;using mint=modint998244353;int main() {cin.tie(nullptr);ios::sync_with_stdio(false);int N;cin>>N;vector<string> S(N);for(int i=0;i<N;i++)cin>>S[i];sort(S.begin(),S.end(),[](auto const&L,auto const& R){if(L+R<R+L)return true;else return false;});string T="";for(int i=0;i<N;i++)T+=S[i];ll an=0;for(auto t:T)an=(10*an+t-'0')%998244353;cout<<an<<"\n";}