結果

問題 No.11 カードマッチ
ユーザー suppy193suppy193
提出日時 2017-01-26 17:07:56
言語 Ruby
(3.3.0)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 348 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 11,340 KB
実行使用メモリ 15,324 KB
最終ジャッジ日時 2023-08-25 00:01:52
合計ジャッジ時間 3,224 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,280 KB
testcase_01 AC 77 ms
15,308 KB
testcase_02 AC 77 ms
15,288 KB
testcase_03 AC 77 ms
15,284 KB
testcase_04 AC 77 ms
15,064 KB
testcase_05 AC 75 ms
15,096 KB
testcase_06 AC 78 ms
15,160 KB
testcase_07 AC 78 ms
15,156 KB
testcase_08 AC 77 ms
15,148 KB
testcase_09 AC 75 ms
15,040 KB
testcase_10 AC 77 ms
15,240 KB
testcase_11 AC 75 ms
15,060 KB
testcase_12 AC 76 ms
15,320 KB
testcase_13 AC 77 ms
15,152 KB
testcase_14 AC 77 ms
15,184 KB
testcase_15 AC 76 ms
15,324 KB
testcase_16 AC 76 ms
15,084 KB
testcase_17 AC 76 ms
15,312 KB
testcase_18 AC 77 ms
15,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

w = gets.strip.to_i
h = gets.strip.to_i
n = gets.strip.to_i
cards = []
n.times do
	card = gets.strip.split(' ').map(&:to_i)	
	cards << card
end
set_s = []
set_k = []
cards.each do |card|
	set_s << card[0]
	set_k << card[1]
end
set_s.uniq!
set_k.uniq!

count = set_s.length * h + set_k.length * w - set_s.length * set_k.length - cards.length
p count
0