結果
問題 | No.11 カードマッチ |
ユーザー |
![]() |
提出日時 | 2016-10-06 01:34:20 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 1,476 bytes |
コンパイル時間 | 749 ms |
コンパイル使用メモリ | 86,788 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 17:59:28 |
合計ジャッジ時間 | 1,482 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
//#include <bits/stdc++.h> #include <assert.h> #include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <iterator> #include <unistd.h> using namespace std; typedef signed long long ll; #define pp(...) (void)printf(__VA_ARGS__) #define For(x,to) for(x=0;x<(to);x++) #define ForAuto(x,arr) for(auto& x:arr) #define ForBeginEnd(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define All(a) (a.begin()),(a.end()) #define Zeros(a) memset(a,0,sizeof(a)) #define Minus(a) memset(a,0xff,sizeof(a)) #define PI 3.14159265 #define EPS (1e-10) #define EPS_eq(a,b) (abs((a)-(b)) < EPS) #pragma GCC diagnostic ignored "-Wconversion" //#define int long long #define INF 1000*1000 int dxy[] = {0, 1, 0, -1, 0}; typedef pair<int, int> P; void pp_int(int x){ printf("%d\n", x); }; int i,j,k; ll M = 100000009; //ios::sync_with_stdio(false); //------------------------------------------------- ll S[105]; ll K[105]; map <ll, ll> mps, mpk; signed main() { ll W,H,N; cin>>W>>H>>N; for(int i=0;i<N;i++){ cin>>S[i]>>K[i]; mps[S[i]]++; mpk[K[i]]++; } ll res = -N; int scount = 0; for (auto p : mps) { res += H; scount++; } for (auto p : mpk) { res += W; res -= scount; } cout<<res<<endl; return 0; }