結果
問題 |
No.11 カードマッチ
|
ユーザー |
![]() |
提出日時 | 2015-11-12 22:24:25 |
言語 | Python2 (2.7.18) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 447 bytes |
コンパイル時間 | 318 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-13 14:32:20 |
合計ジャッジ時間 | 1,031 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 3 |
ソースコード
W = input() H = input() N = input() hand = [tuple(map(int, raw_input().split())) for loop in xrange(N)] cnt = 0 suit_hand = set([]) number_hand = set([]) for card in hand: if card[0] in suit_hand: cnt += W - len(suit_hand) - 1 elif card[1] in suit_hand: cnt += H - len(number_hand) - 1 else: cnt += W - len(number_hand) + H - len(suit_hand) - 2 suit_hand.add(card[0]) number_hand.add(card[1]) print cnt