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