結果

問題 No.1619 Coccinellidae
ユーザー yuruhiyayuruhiya
提出日時 2021-07-22 22:31:03
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 253 bytes
コンパイル時間 613 ms
コンパイル使用メモリ 11,200 KB
実行使用メモリ 16,780 KB
最終ジャッジ日時 2023-09-24 17:46:42
合計ジャッジ時間 5,323 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 RE -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 WA -
testcase_15 RE -
testcase_16 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, m, k = gets.split.map &:to_i
ans = [p] * n
x = 0
loop do
	p = n - 1 - x
	if k >= p
		ans[~x] = x
		k -= p
	else
		ans[k] = x
		break
	end
	x += 1
end
x -= 1
(0...n).each { |i| ans[i] ||= x += 1 }
ans[ans.index ans.max] += m - ans.sum
puts ans * "\n"
0