結果

問題 No.1670 Many Gacha
ユーザー nok0
提出日時 2021-08-17 09:52:29
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 2,257 ms
コンパイル使用メモリ 194,496 KB
最終ジャッジ日時 2025-01-23 22:41:39
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/modint>
using mint = atcoder::modint998244353;

int n, m, a[200000];
mint res;
int main() {
	cin >> n >> m;
	for(int i = 1; i <= m; i++) cin >> a[i];
	for(int j = 0; j < m; j++)
		for(int i = a[j]; i < a[j + 1]; i++)
			res += (mint)a[j + 1] / (n - i);
	cout << res.val() << '\n';
	return 0;
}
0