結果

問題 No.11 カードマッチ
ユーザー zazaboonzazaboon
提出日時 2017-02-05 13:24:01
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 325 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 11,284 KB
実行使用メモリ 21,604 KB
最終ジャッジ日時 2023-08-25 20:26:17
合計ジャッジ時間 11,448 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,276 KB
testcase_01 AC 78 ms
15,124 KB
testcase_02 AC 79 ms
15,016 KB
testcase_03 AC 81 ms
15,020 KB
testcase_04 AC 4,148 ms
21,604 KB
testcase_05 AC 80 ms
15,124 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 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

w = gets.to_i
h = gets.to_i
n = gets.to_i
t = []
n.times do 
  t.push(gets.chomp.split(" ").map(&:to_i))
end
a = 0
m = []
mm = []
w.times do |d|
  p = h - t.map{|u|u[0]}.count(d+1)
  unless(p == h) 
    a += p 
    m.push(d)
    mm.push(t.map{|u|u[1]})
  end 
end
m.uniq!
mm = mm.flatten.uniq
a += mm.size * (w - m.size) 
p a
0