結果
問題 | No.1081 和の和 |
ユーザー | hirokazu1020 |
提出日時 | 2020-06-19 21:27:38 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 814 bytes |
コンパイル時間 | 632 ms |
コンパイル使用メモリ | 92,496 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-16 13:21:33 |
合計ジャッジ時間 | 1,273 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 1 ms
4,376 KB |
testcase_06 | AC | 2 ms
4,380 KB |
testcase_07 | AC | 1 ms
4,376 KB |
testcase_08 | AC | 2 ms
4,380 KB |
testcase_09 | AC | 2 ms
4,376 KB |
testcase_10 | AC | 2 ms
4,376 KB |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<sstream> #include<cstdio> #include<cstdlib> #include<cstring> #include<climits> #include<cmath> #include<string> #include<vector> #include<set> #include<map> #include<queue> #include<numeric> #include<functional> #include<algorithm> #include<bitset> #include<tuple> #include<unordered_set> #include<unordered_map> #include<random> #include<array> #include<cassert> using namespace std; #define INF ((1LL<<60)-1) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define MOD 1000000007 int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; long long a[100]; rep(i, n)cin >> a[i]; rep(i, n - 1) { rep(j, n - i - 1) { a[j] += a[j + 1]; a[j] %= MOD; } } cout << a[0] << endl; return 0; }