結果

問題 No.797 Noelちゃんとピラミッド
ユーザー wasuken
提出日時 2019-03-15 22:02:58
言語 Ruby
(3.4.1)
結果
TLE  
実行時間 -
コード長 278 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 357,872 KB
最終ジャッジ日時 2024-07-01 20:58:45
合計ジャッジ時間 4,339 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other TLE * 1 -- * 59
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def sum_each_to_other(list, size) 
    return list.first if size <= 1 
    sum_list=[]
    for i in (0..size-2) do
        sum_list.push list[i] + list[i+1]
    end
    sum_each_to_other(sum_list,sum_list.count)
end
a = gets.to_i
puts sum_each_to_other(gets.split.map(&:to_i),a)
0