結果

問題 No.1021 Children in Classrooms
ユーザー 小野寺健小野寺健
提出日時 2021-11-06 13:38:34
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 253 bytes
コンパイル時間 52 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 39,808 KB
最終ジャッジ日時 2024-04-25 00:30:11
合計ジャッジ時間 4,740 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
17,792 KB
testcase_01 AC 80 ms
12,416 KB
testcase_02 AC 78 ms
12,288 KB
testcase_03 AC 85 ms
12,288 KB
testcase_04 AC 81 ms
12,672 KB
testcase_05 AC 82 ms
12,672 KB
testcase_06 AC 82 ms
12,288 KB
testcase_07 AC 85 ms
12,544 KB
testcase_08 AC 83 ms
12,544 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, M = gets.split(" ").map{|s| s.to_i}
a = gets.split(" ").map{|s| s.to_i}
S = gets.strip.split("")

S.each {|c|
	if c == "L" then
		x = a.shift
		a[0] += x
		a << 0
	else
		x = a.pop
		a[-1] += x
		a.unshift(0)
	end
}

print a.map{|i| i.to_s}.join(" ")
0