結果
| 問題 | No.11 カードマッチ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-05-29 22:48:11 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 5,000 ms |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 665 ms |
| コンパイル使用メモリ | 20,704 KB |
| 実行使用メモリ | 15,356 KB |
| 最終ジャッジ日時 | 2026-04-28 05:00:07 |
| 合計ジャッジ時間 | 3,891 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
W=int(input())
H=int(input())
N=int(input())
s=0;
m=[]
n=[]
for i in range(0,N):
S,K=map(int,input().split())
if (S not in m) and (K not in n):
H-=1
W-=1
s+=H+W
elif (S in m) and (K not in n):
H-=1
s+=W-1
elif (K in n) and (S not in m):
W-=1
s+=H-1
else: s-=1
m.append(S)
n.append(K)
print(s)