結果
問題 |
No.1081 和の和
|
ユーザー |
|
提出日時 | 2024-03-26 13:07:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 420 bytes |
コンパイル時間 | 3,869 ms |
コンパイル使用メモリ | 250,556 KB |
最終ジャッジ日時 | 2025-02-20 13:52:10 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using ld = long double; int main() { int N; cin >> N; vector<ll> a(N + 1); for (int i = 1; i <= N; i++) cin >> a[i]; for (int i = 1; i <= N - 1; i++) { for (int j = 1; j <= (N - 1) - i + 1; j++) { a[j] = (a[j] + a[j + 1]) % 1000000007; } } cout << a[1] << endl; return 0; }