結果

問題 No.459 C-VS for yukicoder
ユーザー cielciel
提出日時 2016-12-12 14:18:47
言語 Ruby
(3.3.0)
結果
AC  
実行時間 327 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 11,260 KB
実行使用メモリ 19,416 KB
最終ジャッジ日時 2023-08-27 02:41:24
合計ジャッジ時間 10,453 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,156 KB
testcase_01 AC 75 ms
15,024 KB
testcase_02 AC 77 ms
15,272 KB
testcase_03 AC 76 ms
15,284 KB
testcase_04 AC 73 ms
15,060 KB
testcase_05 AC 82 ms
15,316 KB
testcase_06 AC 76 ms
15,028 KB
testcase_07 AC 75 ms
15,236 KB
testcase_08 AC 74 ms
15,168 KB
testcase_09 AC 75 ms
15,120 KB
testcase_10 AC 76 ms
15,244 KB
testcase_11 AC 76 ms
15,156 KB
testcase_12 AC 75 ms
15,288 KB
testcase_13 AC 75 ms
15,156 KB
testcase_14 AC 75 ms
15,048 KB
testcase_15 AC 83 ms
15,456 KB
testcase_16 AC 81 ms
15,192 KB
testcase_17 AC 78 ms
15,248 KB
testcase_18 AC 77 ms
15,132 KB
testcase_19 AC 80 ms
15,240 KB
testcase_20 AC 79 ms
15,056 KB
testcase_21 AC 318 ms
19,416 KB
testcase_22 AC 325 ms
18,864 KB
testcase_23 AC 327 ms
18,384 KB
testcase_24 AC 163 ms
17,272 KB
testcase_25 AC 114 ms
18,328 KB
testcase_26 AC 121 ms
17,984 KB
testcase_27 AC 113 ms
17,044 KB
testcase_28 AC 110 ms
16,868 KB
testcase_29 AC 168 ms
18,116 KB
testcase_30 AC 122 ms
17,788 KB
testcase_31 AC 121 ms
17,488 KB
testcase_32 AC 86 ms
16,352 KB
testcase_33 AC 129 ms
17,280 KB
testcase_34 AC 142 ms
17,460 KB
testcase_35 AC 89 ms
17,024 KB
testcase_36 AC 143 ms
17,460 KB
testcase_37 AC 86 ms
16,688 KB
testcase_38 AC 129 ms
17,832 KB
testcase_39 AC 90 ms
16,908 KB
testcase_40 AC 123 ms
17,392 KB
testcase_41 AC 87 ms
16,208 KB
testcase_42 AC 118 ms
17,360 KB
testcase_43 AC 135 ms
17,480 KB
testcase_44 AC 94 ms
17,440 KB
testcase_45 AC 90 ms
17,272 KB
testcase_46 AC 91 ms
17,336 KB
testcase_47 AC 87 ms
16,536 KB
testcase_48 AC 134 ms
17,524 KB
testcase_49 AC 87 ms
16,848 KB
testcase_50 AC 126 ms
17,728 KB
testcase_51 AC 86 ms
16,540 KB
testcase_52 AC 108 ms
17,160 KB
testcase_53 AC 90 ms
17,252 KB
testcase_54 AC 129 ms
17,804 KB
testcase_55 AC 99 ms
16,916 KB
testcase_56 AC 121 ms
17,236 KB
testcase_57 AC 87 ms
16,536 KB
testcase_58 AC 143 ms
17,468 KB
testcase_59 AC 95 ms
17,168 KB
testcase_60 AC 106 ms
17,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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=[3-c0[i][j],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