結果

問題 No.11 カードマッチ
ユーザー Yut176Yut176
提出日時 2017-07-28 18:16:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 717 bytes
コンパイル時間 1,326 ms
コンパイル使用メモリ 102,280 KB
実行使用メモリ 814,104 KB
最終ジャッジ日時 2024-04-18 11:45:31
合計ジャッジ時間 3,089 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 MLE -
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>
#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