結果

問題 No.11 カードマッチ
ユーザー DialBirdDialBird
提出日時 2017-02-12 19:14:35
言語 Ruby
(3.3.0)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 288 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 11,356 KB
実行使用メモリ 15,372 KB
最終ジャッジ日時 2023-08-28 14:53:52
合計ジャッジ時間 2,379 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,372 KB
testcase_01 AC 80 ms
15,140 KB
testcase_02 AC 77 ms
15,160 KB
testcase_03 AC 76 ms
15,324 KB
testcase_04 AC 76 ms
15,284 KB
testcase_05 AC 76 ms
15,136 KB
testcase_06 AC 76 ms
15,136 KB
testcase_07 AC 77 ms
15,168 KB
testcase_08 AC 77 ms
15,324 KB
testcase_09 AC 77 ms
15,292 KB
testcase_10 AC 76 ms
15,128 KB
testcase_11 AC 76 ms
15,076 KB
testcase_12 AC 82 ms
14,992 KB
testcase_13 AC 76 ms
15,068 KB
testcase_14 AC 77 ms
15,004 KB
testcase_15 AC 76 ms
15,104 KB
testcase_16 AC 77 ms
15,320 KB
testcase_17 AC 76 ms
15,000 KB
testcase_18 AC 77 ms
15,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

W = gets.to_i
H = gets.to_i
N = gets.to_i

w_list = []
h_list = []

N.times do
  s,k = gets.chomp.split.map(&:to_i)
  w_list << s
  h_list << k
end

w_not_used_count = W - w_list.uniq.count
h_not_used_count = H - h_list.uniq.count

puts (W * H) - (w_not_used_count * h_not_used_count) - N
0