結果
問題 |
No.11 カードマッチ
|
ユーザー |
![]() |
提出日時 | 2016-03-02 10:48:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 878 bytes |
コンパイル時間 | 707 ms |
コンパイル使用メモリ | 90,164 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 20:01:55 |
合計ジャッジ時間 | 1,385 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
/* -*- coding: utf-8 -*- * * 11.cc: No.11 カードマッチ - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ const int MAX_N = 100; /* typedef */ typedef long long ll; typedef set<int> si; /* global variables */ /* subroutines */ /* main */ int main() { ll w, h; int n; cin >> w >> h >> n; si xset, yset; for (int i = 0; i < n; i++) { int xi, yi; cin >> xi >> yi; xset.insert(xi); yset.insert(yi); } int xn = xset.size(), yn = yset.size(); ll ans = h * xn + w * yn - xn * yn - n; printf("%lld\n", ans); return 0; }