結果
問題 |
No.797 Noelちゃんとピラミッド
|
ユーザー |
![]() |
提出日時 | 2019-03-15 21:33:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 353 bytes |
コンパイル時間 | 492 ms |
コンパイル使用メモリ | 58,204 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 20:30:39 |
合計ジャッジ時間 | 3,717 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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>a(n); for(int i=0; i<n; i++)cin >> a[i]; long c=1; 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; }