結果

問題 No.459 C-VS for yukicoder
ユーザー miraxialmiraxial
提出日時 2016-12-10 01:43:40
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 670 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 11,592 KB
実行使用メモリ 20,784 KB
最終ジャッジ日時 2023-08-19 06:50:39
合計ジャッジ時間 13,601 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
15,260 KB
testcase_01 WA -
testcase_02 AC 71 ms
15,304 KB
testcase_03 AC 72 ms
15,160 KB
testcase_04 AC 70 ms
15,360 KB
testcase_05 AC 69 ms
15,268 KB
testcase_06 AC 69 ms
15,300 KB
testcase_07 AC 70 ms
15,044 KB
testcase_08 AC 71 ms
15,244 KB
testcase_09 AC 68 ms
15,268 KB
testcase_10 AC 70 ms
15,092 KB
testcase_11 WA -
testcase_12 AC 68 ms
15,144 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 73 ms
15,180 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 403 ms
20,784 KB
testcase_22 AC 332 ms
20,700 KB
testcase_23 AC 406 ms
20,568 KB
testcase_24 AC 174 ms
16,648 KB
testcase_25 AC 117 ms
15,696 KB
testcase_26 AC 111 ms
15,572 KB
testcase_27 AC 115 ms
15,568 KB
testcase_28 AC 109 ms
15,748 KB
testcase_29 AC 165 ms
16,720 KB
testcase_30 AC 111 ms
15,596 KB
testcase_31 WA -
testcase_32 AC 80 ms
15,228 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 77 ms
15,348 KB
testcase_38 WA -
testcase_39 AC 84 ms
15,480 KB
testcase_40 WA -
testcase_41 AC 80 ms
15,340 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 78 ms
15,196 KB
testcase_48 WA -
testcase_49 AC 77 ms
15,488 KB
testcase_50 WA -
testcase_51 AC 77 ms
15,344 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 AC 92 ms
15,504 KB
testcase_56 WA -
testcase_57 AC 75 ms
15,360 KB
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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