結果
問題 | No.2729 Addition and Multiplication in yukicoder (Easy) |
ユーザー |
👑 ![]() |
提出日時 | 2024-03-12 01:44:13 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 139 ms / 2,000 ms |
コード長 | 417 bytes |
コンパイル時間 | 620 ms |
コンパイル使用メモリ | 80,200 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-09-29 22:07:50 |
合計ジャッジ時間 | 3,431 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <algorithm> #include <iostream> #include <vector> using namespace std; using ll = long long; ll mod = 998244353; int main() { ll N; cin >> N; vector<ll> A(N); for (ll i = 0; i < N; i++) { cin >> A[i]; } sort(A.begin(), A.end()); ll x = 0; for (ll i = 0; i < N; i++) { x = (x * 10LL) % mod; x = (x + (A[i] % mod)) % mod; } cout << x << endl; }