結果

問題 No.11 カードマッチ
ユーザー kou6839kou6839
提出日時 2014-11-11 13:35:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 435 bytes
コンパイル時間 1,970 ms
コンパイル使用メモリ 74,988 KB
実行使用メモリ 41,904 KB
最終ジャッジ日時 2024-04-20 00:12:46
合計ジャッジ時間 5,270 ms
ジャッジサーバーID
(参考情報)
judge6 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
41,108 KB
testcase_01 AC 113 ms
41,084 KB
testcase_02 AC 115 ms
41,588 KB
testcase_03 AC 116 ms
41,344 KB
testcase_04 AC 127 ms
41,892 KB
testcase_05 AC 109 ms
41,400 KB
testcase_06 AC 135 ms
41,572 KB
testcase_07 AC 133 ms
41,808 KB
testcase_08 AC 134 ms
41,904 KB
testcase_09 AC 130 ms
41,596 KB
testcase_10 AC 128 ms
41,472 KB
testcase_11 AC 128 ms
41,812 KB
testcase_12 AC 131 ms
41,592 KB
testcase_13 AC 132 ms
41,664 KB
testcase_14 AC 130 ms
41,724 KB
testcase_15 AC 124 ms
41,504 KB
testcase_16 AC 121 ms
41,760 KB
testcase_17 AC 132 ms
41,584 KB
testcase_18 AC 130 ms
41,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
 

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int W = sc.nextInt();
		int H = sc.nextInt();
		int N = sc.nextInt();
		Set<Integer> a = new HashSet<>();
		Set<Integer> b = new HashSet<>();
		for(int i=0;i<N;i++){
			a.add(sc.nextInt());
			b.add(sc.nextInt());
		}
		System.out.println(a.size()*H+b.size()*W-a.size()*b.size()-N);
		
	}
}	
0