結果
| 問題 | No.11 カードマッチ | 
| コンテスト | |
| ユーザー |  msm1993 | 
| 提出日時 | 2019-04-16 13:06:02 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 11 ms / 5,000 ms | 
| コード長 | 543 bytes | 
| コンパイル時間 | 564 ms | 
| コンパイル使用メモリ | 72,016 KB | 
| 実行使用メモリ | 18,996 KB | 
| 最終ジャッジ日時 | 2024-09-22 08:13:08 | 
| 合計ジャッジ時間 | 1,436 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
ソースコード
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
#define ll long long
int main(){
   ll w,h,n;
   cin>>w>>h>>n;
   int s[100],k[100];
   vector<ll> W(w+1),H(h+1);
   fill(W.begin(),W.end(),1);
   fill(H.begin(),H.end(),1);
   W[0]=H[0]=0;
   for(int i=0;i<n;++i){
       cin>>s[i]>>k[i];
       W[s[i]]=0;
       H[k[i]]=0;
   }
   ll sw=0,sh=0; //除く和
   for(int i=0;i<=w;++i) sw+=W[i];
   for(int i=0;i<=h;++i) sh+=H[i];
   cout<<w*h-n-sw*sh<<endl;
   return 0;
}
            
            
            
        