結果
| 問題 |
No.797 Noelちゃんとピラミッド
|
| コンテスト | |
| ユーザー |
しとお
|
| 提出日時 | 2019-03-15 21:38:24 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 392 bytes |
| コンパイル時間 | 538 ms |
| コンパイル使用メモリ | 69,612 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-01 20:34:43 |
| 合計ジャッジ時間 | 3,866 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 57 |
ソースコード
#include <iostream>
#include <vector>
#define llong long long
using namespace std;
const llong mod=int(1e9)+7;
int main(){
llong n;
cin >> n;
vector<llong>a(n);
for(int i=0; i<n; i++)cin >> a[i];
llong c=1;
llong ret=0;
for(int i=0; i<n; i++){
ret+=a[i]*c;
ret%=mod;
c=(c*(n-i-1)/(llong)(i+1))%mod;
}
cout << ret;
return 0;
}
しとお