結果
問題 |
No.11 カードマッチ
|
ユーザー |
![]() |
提出日時 | 2019-08-22 13:30:25 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 148 ms / 5,000 ms |
コード長 | 642 bytes |
コンパイル時間 | 2,361 ms |
コンパイル使用メモリ | 74,708 KB |
実行使用メモリ | 54,284 KB |
最終ジャッジ日時 | 2024-10-12 08:13:00 |
合計ジャッジ時間 | 6,177 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
import java.util.HashSet; import java.util.Scanner; public class Main { static boolean memo[]; static int ans, min; public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); long w = sc.nextLong(); long h = sc.nextLong(); int n = sc.nextInt(); HashSet<Integer> hs1 = new HashSet<>(); HashSet<Integer> hs2 = new HashSet<>(); int mark, num; long sum; for (int i = 0; i < n; i++) { mark = sc.nextInt(); num = sc.nextInt(); hs1.add(mark); hs2.add(num); } sum = hs1.size() * h + (w - hs1.size()) * hs2.size() - n; System.out.println(sum); } }