結果
問題 | No.11 カードマッチ |
ユーザー | togari_takamoto |
提出日時 | 2015-12-13 07:33:09 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 12 ms / 5,000 ms |
コード長 | 788 bytes |
コンパイル時間 | 768 ms |
コンパイル使用メモリ | 97,012 KB |
実行使用メモリ | 26,552 KB |
最終ジャッジ日時 | 2023-08-02 00:15:22 |
合計ジャッジ時間 | 1,698 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | AC | 10 ms
20,536 KB |
testcase_05 | AC | 2 ms
4,380 KB |
testcase_06 | AC | 12 ms
26,552 KB |
testcase_07 | AC | 2 ms
4,380 KB |
testcase_08 | AC | 7 ms
13,284 KB |
testcase_09 | AC | 11 ms
26,456 KB |
testcase_10 | AC | 9 ms
20,492 KB |
testcase_11 | AC | 8 ms
17,680 KB |
testcase_12 | AC | 9 ms
17,892 KB |
testcase_13 | AC | 7 ms
14,484 KB |
testcase_14 | AC | 8 ms
15,644 KB |
testcase_15 | AC | 1 ms
4,380 KB |
testcase_16 | AC | 2 ms
4,380 KB |
testcase_17 | AC | 1 ms
4,376 KB |
testcase_18 | AC | 2 ms
4,380 KB |
ソースコード
#include <iostream> #include <vector> #include <array> #include <algorithm> #include <string> #include <map> #include <queue> #include <iomanip> #include <numeric> #include <memory> #include <limits.h> #include <set> #include <cassert> #include <cmath> #include <bitset> #include <functional> #include <limits> using namespace std; typedef long long ll; typedef unsigned long long ull; #define REP(i,n) for(ll i=0; i<(n); ++i) #define TEN(x) ((ll)1e##x) #define ALL(v) (v).begin(), (v).end() int main(){ ll w,h,n; cin >> w >> h >> n; vector<vector<ll>> wh(w); set<ll> k_set; REP(i, n) { ll s, k; cin >> s >> k; s--; k--; wh[s].push_back(k); k_set.insert(k); } ll c = 0; REP(i, w) c += (wh[i].empty()) ? k_set.size() : h - wh[i].size(); cout << c << endl; return 0; }