結果

問題 No.11 カードマッチ
ユーザー lioolioo
提出日時 2021-04-13 22:46:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 485 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 64,020 KB
実行使用メモリ 9,476 KB
最終ジャッジ日時 2023-09-12 13:29:51
合計ジャッジ時間 7,254 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>

using namespace std;

int main(){
    bool existw[1000001]={};
    bool existh[1000001]={};
    int W;
    int H;
    int N;

    cin>>W>>H>>N;
    for(int i=0;i<N;i++){
        int s,k;
        cin>>s>>k;
        existw[s]=existh[k]=true;
    }

    long long int count =0;
    for(int i=1;i<=W;i++){
        for(int j=1;j<=H;j++){
            if(existw[i]||existh[j]){
                count++;
            }
        }
    }
    count-=N;
    cout<<count<<endl;
}
0