結果

問題 No.459 C-VS for yukicoder
ユーザー miraxialmiraxial
提出日時 2016-12-10 01:12:01
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 642 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 11,256 KB
実行使用メモリ 20,872 KB
最終ジャッジ日時 2023-08-19 06:45:04
合計ジャッジ時間 17,515 ms
ジャッジサーバーID
(参考情報)
judge13 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 82 ms
15,088 KB
testcase_02 WA -
testcase_03 AC 80 ms
15,172 KB
testcase_04 AC 83 ms
15,252 KB
testcase_05 AC 81 ms
15,016 KB
testcase_06 WA -
testcase_07 AC 80 ms
15,024 KB
testcase_08 WA -
testcase_09 AC 81 ms
15,156 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 81 ms
15,328 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 132 ms
15,768 KB
testcase_26 AC 131 ms
15,792 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 89 ms
15,268 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 87 ms
15,324 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 91 ms
15,484 KB
testcase_50 WA -
testcase_51 AC 89 ms
15,196 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 AC 90 ms
15,412 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=[]
  3.times do |i|
    t=e[0]+i
    d[t]-=1
    g<< c[t]-d[t]*3
    c[t]=d[t]*3
  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+[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