結果
問題 |
No.11 カードマッチ
|
ユーザー |
|
提出日時 | 2020-01-02 18:39:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 487 bytes |
コンパイル時間 | 1,823 ms |
コンパイル使用メモリ | 171,616 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 18:14:36 |
合計ジャッジ時間 | 2,302 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; using lint=long long; int main(){ lint w,h,n; scanf("%lld%lld%lld",&w,&h,&n); vector<int> row(n),col(n); rep(i,n) scanf("%d%d",&col[i],&row[i]); sort(row.begin(),row.end()); sort(col.begin(),col.end()); row.erase(unique(row.begin(),row.end()),row.end()); col.erase(unique(col.begin(),col.end()),col.end()); cout<<w*row.size()+h*col.size()-1LL*row.size()*col.size()-n<<'\n'; return 0; }