結果
問題 |
No.1081 和の和
|
ユーザー |
![]() |
提出日時 | 2023-08-26 19:12:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 473 bytes |
コンパイル時間 | 1,136 ms |
コンパイル使用メモリ | 102,868 KB |
最終ジャッジ日時 | 2025-02-16 14:48:17 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 |
ソースコード
#include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> using namespace std; int main() { long long n, mod = 1e9+7; cin >> n; vector<long long> v(n); for (int i = 0; i < n; i++) cin >> v[i]; for (int i = 0; i < n-1; i++){ for (int j = 0; j < n-i -1; j++){ v[j] = v[j] + v[j+1]; v[j] %= mod; } } cout << v[0] << endl; }