結果

問題 No.11 カードマッチ
ユーザー DialBirdDialBird
提出日時 2016-11-16 10:27:18
言語 Ruby
(3.3.0)
結果
AC  
実行時間 93 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 11,236 KB
実行使用メモリ 30,936 KB
最終ジャッジ日時 2023-08-17 07:22:08
合計ジャッジ時間 2,730 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,052 KB
testcase_01 AC 83 ms
15,160 KB
testcase_02 AC 80 ms
15,108 KB
testcase_03 AC 79 ms
15,112 KB
testcase_04 AC 86 ms
21,616 KB
testcase_05 AC 80 ms
15,228 KB
testcase_06 AC 93 ms
30,936 KB
testcase_07 AC 84 ms
20,360 KB
testcase_08 AC 86 ms
23,284 KB
testcase_09 AC 92 ms
30,608 KB
testcase_10 AC 91 ms
27,812 KB
testcase_11 AC 89 ms
26,496 KB
testcase_12 AC 90 ms
27,028 KB
testcase_13 AC 90 ms
25,980 KB
testcase_14 AC 84 ms
20,840 KB
testcase_15 AC 79 ms
15,300 KB
testcase_16 AC 79 ms
15,644 KB
testcase_17 AC 80 ms
15,560 KB
testcase_18 AC 79 ms
15,680 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:13: warning: assigned but unused variable - ans
Syntax OK

ソースコード

diff #

def main
  w = gets.to_i
  h = gets.to_i
  n = gets.to_i
  w_list = [nil]*(w+1)
  h_list = [nil]*(h+1)
  n.times do
    s,k = gets.split.map(&:to_i)
    w_list[s] = true if w_list[s].nil?
    h_list[k] = true if h_list[k].nil?
  end
  not_used = (w - (w_list.compact!.length)) * (h - (h_list.compact!.length))
  ans = w * h - not_used - n
end

puts main()
0