結果

問題 No.11 カードマッチ
ユーザー eve__fuyukieve__fuyuki
提出日時 2018-03-13 23:12:44
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 475 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 50,896 KB
実行使用メモリ 5,620 KB
最終ジャッジ日時 2023-08-15 21:27:08
合計ジャッジ時間 1,523 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,312 KB
testcase_01 AC 4 ms
5,480 KB
testcase_02 AC 3 ms
5,388 KB
testcase_03 AC 3 ms
5,296 KB
testcase_04 AC 3 ms
5,280 KB
testcase_05 AC 3 ms
5,296 KB
testcase_06 AC 3 ms
5,280 KB
testcase_07 AC 3 ms
5,296 KB
testcase_08 AC 3 ms
5,288 KB
testcase_09 AC 3 ms
5,312 KB
testcase_10 AC 3 ms
5,388 KB
testcase_11 AC 3 ms
5,284 KB
testcase_12 AC 3 ms
5,280 KB
testcase_13 AC 4 ms
5,620 KB
testcase_14 AC 3 ms
5,512 KB
testcase_15 AC 3 ms
5,280 KB
testcase_16 AC 3 ms
5,296 KB
testcase_17 AC 3 ms
5,324 KB
testcase_18 AC 3 ms
5,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
int main(){
    int W,H,N,S,K,ans;
    bool mark[1000001] = {};
    bool num[1000001] = {};
    int Wc = 0;
    int Hc = 0;
    cin >> W >> H >> N;
    for(int i=0;i<N;i++){
        cin >> S >> K;
        if(! mark[S]){
            mark[S] = true;
            Wc++;
        }
        if(! num[K]){
            num[K] = true;
            Hc++;
        }
    }
    ans = Wc*H + Hc*W - Wc*Hc -N;
    cout <<  ans << endl;
    return 0;
}
0