結果
| 問題 | 
                            No.797 Noelちゃんとピラミッド
                             | 
                    
| コンテスト | |
| ユーザー | 
                             urutom
                         | 
                    
| 提出日時 | 2019-04-04 01:19:59 | 
| 言語 | Ruby  (3.4.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 137 bytes | 
| コンパイル時間 | 144 ms | 
| コンパイル使用メモリ | 7,680 KB | 
| 実行使用メモリ | 213,760 KB | 
| 最終ジャッジ日時 | 2024-12-23 17:11:57 | 
| 合計ジャッジ時間 | 97,839 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 33 TLE * 27 | 
コンパイルメッセージ
Syntax OK
ソースコード
M=10**9+7
n=gets.to_i-1
a=gets.split.map(&:to_i)
ans=0
comb=1
a.each_with_index{|v,i|
  ans+=comb*v
  comb=comb*(n-i)/(i+1)
}
puts ans%M
            
            
            
        
            
urutom