結果
| 問題 | No.11 カードマッチ |
| コンテスト | |
| ユーザー |
atkrym
|
| 提出日時 | 2016-11-03 11:12:47 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 835 bytes |
| 記録 | |
| コンパイル時間 | 1,764 ms |
| コンパイル使用メモリ | 82,328 KB |
| 実行使用メモリ | 711,744 KB |
| 最終ジャッジ日時 | 2026-05-19 09:41:54 |
| 合計ジャッジ時間 | 8,033 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 MLE * 10 |
ソースコード
import java.util.*;
public class Main {
private static Scanner sc = new Scanner(System.in);
public static void main(String[] args) throws Exception {
int w = sc.nextInt();
int h = sc.nextInt();
int n = sc.nextInt();
boolean[][] b = new boolean[w][h];
long ret = 0;
for (int i = 0;i < n;i++) {
int s = sc.nextInt()-1;
int k = sc.nextInt()-1;
for (int j = 0;j < h;j++) {
if (!b[s][j]) {
b[s][j] = true;
ret++;
}
}
for (int j = 0;j < w;j++) {
if (!b[j][k]) {
b[j][k] = true;
ret++;
}
}
}
System.out.println(ret-n);
}
}
atkrym