結果

問題 No.459 C-VS for yukicoder
ユーザー cielciel
提出日時 2016-12-12 14:17:06
言語 Ruby
(3.2.2)
結果
RE  
実行時間 -
コード長 413 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 11,472 KB
実行使用メモリ 19,640 KB
最終ジャッジ日時 2023-08-19 20:26:06
合計ジャッジ時間 12,607 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,136 KB
testcase_01 AC 79 ms
15,320 KB
testcase_02 AC 80 ms
15,232 KB
testcase_03 AC 79 ms
15,216 KB
testcase_04 AC 80 ms
15,148 KB
testcase_05 AC 80 ms
15,208 KB
testcase_06 AC 80 ms
15,244 KB
testcase_07 AC 80 ms
15,260 KB
testcase_08 AC 82 ms
15,092 KB
testcase_09 AC 80 ms
15,220 KB
testcase_10 AC 80 ms
15,096 KB
testcase_11 AC 80 ms
15,096 KB
testcase_12 AC 80 ms
15,152 KB
testcase_13 AC 80 ms
15,232 KB
testcase_14 AC 80 ms
15,096 KB
testcase_15 AC 87 ms
15,064 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 82 ms
15,076 KB
testcase_19 AC 81 ms
15,128 KB
testcase_20 AC 85 ms
15,132 KB
testcase_21 AC 338 ms
19,640 KB
testcase_22 AC 339 ms
18,896 KB
testcase_23 AC 344 ms
18,544 KB
testcase_24 AC 169 ms
17,204 KB
testcase_25 AC 117 ms
18,404 KB
testcase_26 AC 121 ms
17,868 KB
testcase_27 AC 114 ms
17,184 KB
testcase_28 AC 115 ms
16,804 KB
testcase_29 AC 176 ms
18,048 KB
testcase_30 AC 124 ms
17,828 KB
testcase_31 RE -
testcase_32 AC 89 ms
16,564 KB
testcase_33 AC 135 ms
17,256 KB
testcase_34 AC 145 ms
17,352 KB
testcase_35 RE -
testcase_36 AC 147 ms
17,196 KB
testcase_37 RE -
testcase_38 AC 135 ms
17,620 KB
testcase_39 RE -
testcase_40 RE -
testcase_41 AC 88 ms
15,920 KB
testcase_42 RE -
testcase_43 AC 140 ms
17,688 KB
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 RE -
testcase_48 AC 140 ms
17,444 KB
testcase_49 AC 94 ms
16,860 KB
testcase_50 AC 133 ms
17,524 KB
testcase_51 AC 92 ms
16,352 KB
testcase_52 RE -
testcase_53 RE -
testcase_54 AC 141 ms
17,704 KB
testcase_55 AC 105 ms
16,956 KB
testcase_56 RE -
testcase_57 AC 90 ms
16,736 KB
testcase_58 AC 149 ms
17,468 KB
testcase_59 RE -
testcase_60 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - w
Syntax OK

ソースコード

diff #

h,w,n=gets.split.map(&:to_i)
s=h.times.map{gets.chomp.chars}.transpose.map{|e|h-(e.index('#')||h)}
c=n.times.map{gets.to_i}
c0=[]
idx=(0...n).sort_by{|e|c[e]}
idx.each{|e|
	k=(0..2).find{|k|s[c[e]+k]>0}
	s[c[e]+k]-=1
	a=[0,0,0];a[k]=1
	c0[e]=a
}
idx.each{|i|
	3.times{|j|
		dec=[j==0 ? 2 : 3,s[c[i]+j]].min
		s[c[i]+j]-=dec
		c0[i][j]+=dec
	}
}
c0.each{|e|puts e.map{|f|['.']*(3-f)+['#']*f}.transpose.map(&:join)}
0