結果
| 問題 |
No.2729 Addition and Multiplication in yukicoder (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-19 21:25:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 342 bytes |
| コンパイル時間 | 2,129 ms |
| コンパイル使用メモリ | 196,776 KB |
| 最終ジャッジ日時 | 2025-02-21 03:37:22 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
main.cpp:16:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d", &v);
| ~~~~~^~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
typedef long long LL;
const int N = 2e5 + 7;
const int MOD = 998244353;
int n, m;
int main() {
scanf("%d", &n);
std::vector<int> a(n);
for(int &v: a)
scanf("%d", &v);
std::sort(a.begin(), a.end());
int x = 0;
for(int v: a)
x = (10LL * x + v) % MOD;
printf("%d\n", x);
return 0;
}