結果
問題 |
No.2941 Sigma Music Game Score Problem
|
ユーザー |
|
提出日時 | 2024-10-18 23:00:26 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 454 bytes |
コンパイル時間 | 4,188 ms |
コンパイル使用メモリ | 254,100 KB |
最終ジャッジ日時 | 2025-02-24 21:09:54 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using mint = modint998244353; using ll = long long; int main () { ll M, N; cin >> M >> N; std::vector<ll> A = {0}; for (int i = 0; i < N; i ++) { ll a; cin >> a; A.push_back(a); } A.push_back(M + 1); mint ans = 0; for (int i = 0; i <= N; i ++) { mint d = A[i + 1] - A[i]; ans += d * (d + 1) * (2 * d + 1) / 6; } cout << ans.val() << endl; }