結果

問題 No.459 C-VS for yukicoder
ユーザー miraxialmiraxial
提出日時 2016-12-10 00:51:10
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 742 bytes
コンパイル時間 597 ms
コンパイル使用メモリ 11,396 KB
実行使用メモリ 19,892 KB
最終ジャッジ日時 2023-09-26 22:34:24
合計ジャッジ時間 13,186 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,184 KB
testcase_01 AC 83 ms
15,176 KB
testcase_02 AC 82 ms
15,232 KB
testcase_03 AC 86 ms
15,180 KB
testcase_04 AC 82 ms
15,088 KB
testcase_05 AC 81 ms
15,136 KB
testcase_06 AC 82 ms
15,040 KB
testcase_07 AC 82 ms
15,252 KB
testcase_08 AC 82 ms
15,148 KB
testcase_09 AC 82 ms
15,240 KB
testcase_10 AC 82 ms
15,048 KB
testcase_11 AC 83 ms
15,084 KB
testcase_12 AC 86 ms
15,316 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 89 ms
15,376 KB
testcase_16 AC 89 ms
15,208 KB
testcase_17 AC 86 ms
15,136 KB
testcase_18 AC 86 ms
15,160 KB
testcase_19 AC 85 ms
15,140 KB
testcase_20 WA -
testcase_21 AC 408 ms
19,772 KB
testcase_22 AC 368 ms
19,892 KB
testcase_23 AC 403 ms
19,508 KB
testcase_24 AC 189 ms
16,564 KB
testcase_25 AC 126 ms
16,004 KB
testcase_26 AC 131 ms
16,144 KB
testcase_27 AC 127 ms
15,624 KB
testcase_28 AC 122 ms
15,896 KB
testcase_29 AC 192 ms
17,504 KB
testcase_30 AC 129 ms
16,228 KB
testcase_31 AC 138 ms
15,988 KB
testcase_32 AC 91 ms
15,320 KB
testcase_33 WA -
testcase_34 AC 161 ms
16,072 KB
testcase_35 AC 95 ms
15,480 KB
testcase_36 AC 167 ms
16,256 KB
testcase_37 AC 95 ms
15,392 KB
testcase_38 WA -
testcase_39 AC 98 ms
15,324 KB
testcase_40 AC 139 ms
15,916 KB
testcase_41 AC 91 ms
15,308 KB
testcase_42 AC 136 ms
15,760 KB
testcase_43 AC 154 ms
16,016 KB
testcase_44 WA -
testcase_45 AC 99 ms
15,444 KB
testcase_46 AC 98 ms
15,300 KB
testcase_47 AC 93 ms
15,236 KB
testcase_48 AC 156 ms
16,196 KB
testcase_49 AC 94 ms
15,488 KB
testcase_50 WA -
testcase_51 AC 94 ms
15,524 KB
testcase_52 WA -
testcase_53 AC 97 ms
15,432 KB
testcase_54 WA -
testcase_55 AC 107 ms
15,612 KB
testcase_56 AC 138 ms
15,656 KB
testcase_57 AC 90 ms
15,460 KB
testcase_58 AC 158 ms
16,364 KB
testcase_59 WA -
testcase_60 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:23: warning: assigned but unused variable - j
Syntax OK

ソースコード

diff #

h,w,n=gets.split.map &:to_i
a=[]
c=[0]*w
h.times do |i|
  a<< g=gets.chomp
  w.times do |i|
    c[i]+=1 if g[i]==?#
  end
end
d=[0]*w
v=*$<.map(&:to_i)
v.each do |e|
  d[e]+=1
  d[e+1]+=1
  d[e+2]+=1
end
n.times do |i|
  v[i]=[v[i],i]
end
w=v.sort
f=[]
v.each do |e|
  j=false
  g=[]
  3.times do |i|
    t=e[0]+i
    d[t]-=1
    if d[t]==0
      g<< c[t]
    else
      if d[t]*3<c[t]
        g<< c[t]-d[t]*3
        c[t]=d[t]*3
      else
        g<< 0
      end
    end
  end
  if g==[0,0,0]
    3.times do |i|
      t=e[0]+i
      if c[t]!=0
        g[i]+=1
        c[t]-=1
        break
      end
    end
  end
  f<< g
end
f.each do |e|
  3.times do |i|
    s=""
    3.times do |j|
      s+=e[j]>=3-i ? ?#:?.
    end
    puts s
  end
end
0