結果

問題 No.1618 Convolution?
ユーザー 小野寺健小野寺健
提出日時 2021-11-16 18:59:21
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 262 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 35,840 KB
最終ジャッジ日時 2024-05-10 01:01:15
合計ジャッジ時間 6,754 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
17,664 KB
testcase_01 AC 77 ms
12,032 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

ソースコード

diff #

N = gets.to_i
A = gets.split(" ").map{|s| s.to_i}
B = gets.split(" ").map{|s| s.to_i}

ans = []
1.upto(2*N) {|k|
	c = 0
	1.upto(N) {|i|
		j = k - i
		next if j > N
		break if j < 1
		c += i * A[j-1] + j * B[i-1]
	}
	ans << c
}

puts ans.map{|i| i.to_s}.join(" ")
0