結果

問題 No.2729 Addition and Multiplication in yukicoder (Easy)
ユーザー 赤信号
提出日時 2024-05-03 10:09:55
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 2,912 ms
コンパイル使用メモリ 262,540 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-24 09:14:48
合計ジャッジ時間 4,742 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")

#ifdef LOCAL
#include "algo/debug_ver3.hpp"
#else
#define debug(...)
#define debugArr(...)
#endif

#include <bits/stdc++.h>

using namespace std;

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	long long const MOD = 998'244'353;

	int n;
	cin >> n;

	vector<long long> a(n);
	for (int i = 0; i < n; ++i) cin >> a[i];
	sort(a.begin(), a.end());

	long long x = 0;
	for (int i = 0; i < n; ++i) x = (10 * x % MOD + a[i]) % MOD;

	cout << x << '\n';
}
0