結果
問題 |
No.797 Noelちゃんとピラミッド
|
ユーザー |
![]() |
提出日時 | 2019-03-15 22:19:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 428 bytes |
コンパイル時間 | 438 ms |
コンパイル使用メモリ | 58,884 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-01 21:07:31 |
合計ジャッジ時間 | 3,629 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 60 |
ソースコード
#include <iostream> #include <vector> #include <utility> #include <algorithm> #include <string> typedef long long ll; #define MOD 1000000007 using namespace std; int main(){ int N, a; ll s, c; cin >> N; c = 1; cin >> a; s = c * a % MOD; for(int i = 0; i < N-1; i++) { cin >> a; c = c * (N - 1 - i) / (i + 1); s += c * a % MOD; } cout << s << endl; return 0; }