結果
問題 |
No.11 カードマッチ
|
ユーザー |
![]() |
提出日時 | 2023-02-22 14:33:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 143 ms / 5,000 ms |
コード長 | 351 bytes |
コンパイル時間 | 220 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 26,496 KB |
最終ジャッジ日時 | 2024-07-22 16:35:44 |
合計ジャッジ時間 | 2,066 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
import sys input = sys.stdin.readline w = int(input()) h = int(input()) n = int(input()) a = [[*map(int, input().split())] for _ in range(n)] mark = [0 for i in range(w)] num = [0 for i in range(h)] for x in a: mark[x[0] - 1] = 1 num[x[1] - 1] = 1 cnt1 = mark.count(1) cnt2 = num.count(1) ans = cnt1 * h + cnt2 * w - cnt1*cnt2 - n print(ans)