結果
問題 | No.1618 Convolution? |
ユーザー | 小野寺健 |
提出日時 | 2021-11-16 19:27:15 |
言語 | Ruby (3.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 270 bytes |
コンパイル時間 | 749 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 38,400 KB |
最終ジャッジ日時 | 2024-05-10 01:31:42 |
合計ジャッジ時間 | 7,367 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 88 ms
17,792 KB |
testcase_01 | AC | 85 ms
12,288 KB |
testcase_02 | TLE | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i A = gets.split(" ").map{|s| s.to_i} B = gets.split(" ").map{|s| s.to_i} C = A.zip(B).map{|a, b| a + b} ans = [] 1.upto(2*N) {|k| c = 0 [k-N, 1].max.upto([k-1, N].min) {|i| j = k - i c += i * C[j-1] } ans << c } puts ans.map{|i| i.to_s}.join(" ")