結果

問題 No.498 ワープクリスタル (給料日編)
ユーザー miraxialmiraxial
提出日時 2017-03-25 00:11:49
言語 Ruby
(3.3.0)
結果
MLE  
実行時間 -
コード長 575 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 11,480 KB
実行使用メモリ 535,072 KB
最終ジャッジ日時 2023-09-20 06:58:18
合計ジャッジ時間 4,847 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,044 KB
testcase_01 AC 87 ms
15,024 KB
testcase_02 AC 84 ms
15,296 KB
testcase_03 AC 85 ms
15,068 KB
testcase_04 MLE -
testcase_05 AC 84 ms
15,280 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:6: warning: assigned but unused variable - r
Syntax OK

ソースコード

diff #

gx,gy,n=gets.split.map &:to_i
a=$<.map{|e|e.split.map &:to_i}
h=Hash.new []
hh=Hash.new []
n.times do |i|
  r=[]
  h.each do |e,v|
    a[i][2].times do |j|
      g=[e[0]+a[i][0]*(j+1),e[1]+a[i][1]*(j+1)]
      hh[g]=hh[g]+v.map{|e|e+[i]*(j+1)}
    end
  end
  a[i][2].times do |j|
    hh[[a[i][0]*(j+1),a[i][1]*(j+1)]]=hh[[a[i][0]*(j+1),a[i][1]*(j+1)]]+[[i]*(j+1)]
  end
  h=hh.dup
end
c=0
b=[0,1]
2.upto(50) do |e|
  b<< b[-1]*e
end
h[[gx,gy]].each do |e|
  hh=Hash.new 0
  e.each do |ee|
    hh[ee]+=1
  end
  g=b[e.size]
  hh.each do |ee,vv|
    g/=vv
  end
  c+=g
end
p c
0