結果
問題 | No.1489 Repeat Cumulative Sum |
ユーザー |
![]() |
提出日時 | 2021-04-23 22:55:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 512 bytes |
コンパイル時間 | 1,993 ms |
コンパイル使用メモリ | 195,380 KB |
最終ジャッジ日時 | 2025-01-21 00:20:03 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/modint>using mint = atcoder::modint1000000007;using ll = long long;using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(0);int n;ll m;cin >> n >> m;n--;vector<int> a(n);for (int i = 0; i < n; i++) {cin >> a[i];}mint r = 0, t = 1;for (int i = 0; i < n; i++) {t *= m + i;t /= i + 1;r += t * a[n - 1 - i];}cout << r.val() << endl;return 0;}