結果

問題 No.797 Noelちゃんとピラミッド
ユーザー saio4016
提出日時 2019-03-15 22:41:13
言語 C++14
(gcc 8.2.0)
結果
RE   .
実行時間 -
コード長 948 Byte
コンパイル時間 1,596 ms
使用メモリ 819,032 KB
最終ジャッジ日時 2019-06-28 11:39:48

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
001sample.txt AC 3 ms
1,508 KB
002sample.txt AC 4 ms
1,504 KB
003sample.txt AC 4 ms
1,504 KB
LEARGE_case1.txt RE -
LEARGE_case2.txt RE -
LEARGE_case3.txt RE -
LEARGE_case4.txt RE -
LEARGE_case5.txt RE -
LEARGE_case6.txt RE -
LEARGE_case7.txt RE -
LEARGE_case8.txt RE -
LEARGE_case9.txt RE -
LEARGE_case10.txt RE -
LEARGE_case11.txt RE -
LEARGE_case12.txt RE -
LEARGE_case13.txt RE -
LEARGE_case14.txt RE -
LEARGE_case15.txt RE -
LEARGE_case16.txt RE -
LEARGE_case17.txt RE -
LEARGE_case18.txt RE -
LEARGE_case19.txt RE -
LEARGE_case20.txt RE -
RANDOM_case1.txt RE -
RANDOM_case2.txt RE -
RANDOM_case3.txt RE -
RANDOM_case4.txt RE -
RANDOM_case5.txt RE -
RANDOM_case6.txt RE -
RANDOM_case7.txt MLE -
RANDOM_case8.txt -- -
RANDOM_case9.txt -- -
RANDOM_case10.txt -- -
RANDOM_case11.txt -- -
RANDOM_case12.txt -- -
RANDOM_case13.txt -- -
RANDOM_case14.txt -- -
RANDOM_case15.txt -- -
RANDOM_case16.txt -- -
RANDOM_case17.txt -- -
RANDOM_case18.txt -- -
RANDOM_case19.txt -- -
RANDOM_case20.txt -- -
SMALL_case1.txt -- -
SMALL_case2.txt -- -
SMALL_case3.txt -- -
SMALL_case4.txt -- -
SMALL_case5.txt -- -
SMALL_case6.txt -- -
SMALL_case7.txt -- -
SMALL_case8.txt -- -
SMALL_case9.txt -- -
SMALL_case10.txt -- -
SMALL_case11.txt -- -
SMALL_case12.txt -- -
SMALL_case13.txt -- -
SMALL_case14.txt -- -
SMALL_case15.txt -- -
SMALL_case16.txt -- -
SMALL_case17.txt -- -
SMALL_case18.txt -- -
SMALL_case19.txt -- -
SMALL_case20.txt -- -
テストケース一括ダウンロード

ソースコード

diff #
#include <bits/stdc++.h>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = 1e9;
//const ll INF = 1e18;
const double EPS = 1e-10;
const int MOD = 1e9+7;
const double PI = acos(-1.0);

int main()
{
	int n;
	cin >> n;
	ll comb[n+10][n+10] = {};
	for(int i = 0; i < n; i++) cin >> comb[1][i];
	for(int i = 2; i <= n; i++){
		for(int j = 0; j <= n-i; j++){
			comb[i][j] = comb[i-1][j] + comb[i-1][j+1];
			comb[i][j] %= MOD;
			//cout << comb[i][j] << ' ';
		}
		//cout << endl;
	}
	ll ans = 0;
	for(int i = 0; i < n; i++){
		ans += comb[n][i];
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}
0