結果
問題 |
No.1081 和の和
|
ユーザー |
![]() |
提出日時 | 2020-06-20 00:33:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 408 bytes |
コンパイル時間 | 1,502 ms |
コンパイル使用メモリ | 170,980 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-03 16:19:10 |
合計ジャッジ時間 | 2,035 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; const int mod = 1e9 + 7; int main() { int n; cin >> n; vector<int> a(n); for(int i = 0; i < n; i++)cin >> a[i]; for(int i = 1; i < n; i++) { vector<int> nxt(a.size() - 1); for(int j = 0; j < (int)a.size() - 1; j++)nxt[j] = ( a[j] + a[j + 1] ) % mod; a = nxt; } cout << a.front() << endl; }