結果

問題 No.11 カードマッチ
ユーザー youjo_yamiotiyoujo_yamioti
提出日時 2018-12-02 10:23:21
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 1,272 ms
コンパイル使用メモリ 146,488 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-10 21:25:43
合計ジャッジ時間 2,185 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int counter(vector<int> vec,int n){
    int i = 0;
    int c = 0;
    int l = vec.size();
    for(i=0;i<l;i++){
        if(vec[i] == n) c++;
    }
    return c;
}
int main(){
    int W,H,N;
    int sum = 0;
    cin >> W >> H >> N;
    vector<int> S(N+1,0);
    vector<int> K(N+1,0);
    for(int i=1;i<=N;i++){
        cin >> S[i];
        cin >> K[i];
    }
    for(int i=1;i<=N;i++){
        int c1,c2;
        c1 = counter(S,S[i]);
        c2 = counter(K,K[i]);
        sum += H + W - 2 - c1 - c2;
    }
    cout << sum << endl;
    return 0;
}
0