結果

問題 No.11 カードマッチ
ユーザー simansiman
提出日時 2016-03-27 03:09:39
言語 Ruby
(3.3.0)
結果
MLE  
実行時間 -
コード長 587 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 817,536 KB
最終ジャッジ日時 2024-04-10 00:39:36
合計ジャッジ時間 2,988 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
12,160 KB
testcase_01 AC 84 ms
12,160 KB
testcase_02 AC 87 ms
12,288 KB
testcase_03 AC 85 ms
12,160 KB
testcase_04 MLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Yukicoder
  def initialize
    w = gets.to_i
    h = gets.to_i
    n = gets.to_i

    marks = Array.new(w){ Array.new(h, 0)}
    nums = Hash.new(0)
    check_list = Hash.new(false)

    n.times do
      s, k = gets.chomp.split.map{|i| i.to_i-1}

      if !check_list[s]
        marks[s] = Array.new(h, 1)
        check_list[s] = true
      end

      nums[k] = 1
    end

    answer = 0

    marks.each do |mark|
      num = 0

      mark.each_with_index do |n, i|
        num += [n, nums[i]].max
      end

      answer += num
    end

    puts answer - n
  end
end

Yukicoder.new
0