結果
| 問題 | No.11 カードマッチ |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2020-11-17 08:30:53 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 78 ms / 5,000 ms |
| コード長 | 572 bytes |
| 記録 | |
| コンパイル時間 | 1,626 ms |
| コンパイル使用メモリ | 83,692 KB |
| 実行使用メモリ | 47,292 KB |
| 最終ジャッジ日時 | 2026-04-03 12:03:33 |
| 合計ジャッジ時間 | 3,584 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
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();
HashSet<Integer> suits = new HashSet<>();
HashSet<Integer> numbers = new HashSet<>();
for (int i = 0; i < n; i++) {
suits.add(sc.nextInt());
numbers.add(sc.nextInt());
}
long ans = suits.size() * ((long)h - numbers.size()) + numbers.size() * w - n;
System.out.print(ans);
}
}
tenten