結果

問題 No.11 カードマッチ
ユーザー Yut176
提出日時 2017-07-28 18:16:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
MLE  
実行時間 -
コード長 717 bytes
コンパイル時間 1,070 ms
コンパイル使用メモリ 102,812 KB
実行使用メモリ 814,712 KB
最終ジャッジ日時 2024-10-10 04:57:08
合計ジャッジ時間 2,959 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 MLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<random>
#include<stack>
#include<queue>
#include<cassert>
using namespace std;
int inf = 1000000000;

int main(void) {
  int w, h, n;
  cin >> w >> h >> n;
  vector< vector<bool> > a(w, vector<bool>(h, false));
  int s, k;
  for(int i=0; i<n; i++){
    cin >> s >> k;
    s--; k--;

    for(int i=0; i<w; i++){
      a[i][k] = true;
    }
    for(int i=0; i<h; i++){
      a[s][i] = true;
    }
  }
  int cnt = 0;
  for(int i=0; i<w; i++){
    for(int j=0; j<h; j++) if( a[i][j] ) cnt++;
  }
  cout << cnt - n << endl;

  return 0;
}
0