結果

問題 No.11 カードマッチ
ユーザー TawaraTawara
提出日時 2015-12-02 23:29:34
言語 Python2
(2.7.18)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 172 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 22,016 KB
最終ジャッジ日時 2024-04-20 01:09:32
合計ジャッジ時間 1,012 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
6,812 KB
testcase_01 AC 9 ms
6,940 KB
testcase_02 AC 9 ms
6,944 KB
testcase_03 AC 9 ms
6,944 KB
testcase_04 AC 19 ms
12,924 KB
testcase_05 AC 9 ms
6,940 KB
testcase_06 AC 31 ms
22,016 KB
testcase_07 AC 19 ms
11,680 KB
testcase_08 AC 21 ms
14,456 KB
testcase_09 AC 29 ms
21,876 KB
testcase_10 AC 27 ms
18,960 KB
testcase_11 AC 24 ms
17,544 KB
testcase_12 AC 24 ms
18,260 KB
testcase_13 AC 23 ms
17,300 KB
testcase_14 AC 18 ms
12,340 KB
testcase_15 AC 9 ms
6,940 KB
testcase_16 AC 10 ms
6,940 KB
testcase_17 AC 10 ms
7,040 KB
testcase_18 AC 10 ms
6,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

f=input;m=n=0;W=f();H=f();N=f()
S=[1]*(W+1);K=[1]*(H+1);a=-N
while N:
	N-=1;s,k=map(int,raw_input().split())
	if S[s]:a+=H-n;S[s]=0;m+=1
	if K[k]:a+=W-m;K[k]=0;n+=1
print a
0