結果
問題 | No.11 カードマッチ |
ユーザー |
![]() |
提出日時 | 2018-12-28 00:39:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 13 ms / 5,000 ms |
コード長 | 543 bytes |
コンパイル時間 | 452 ms |
コンパイル使用メモリ | 62,272 KB |
実行使用メモリ | 18,816 KB |
最終ジャッジ日時 | 2024-10-01 14:56:56 |
合計ジャッジ時間 | 1,182 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include <iostream>#include <algorithm>#include <cstdio>#include <string>#include <vector>using namespace std;#define ll long longint 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;}