Submission #2865071
Source Code Expand
#include<bits/stdc++.h> #define ALL(c) (c).begin(),(c).end() #define EACH(i,c) for(auto i=(c).begin();i!=(c).end();++i) using namespace std; int main(){ int N; cin >> N; vector<pair<int,int>> a(N), c(N); for(int i = 0; i < N; ++i) { cin >> a[i].first >> a[i].second; } for(int i = 0; i < N; ++i){ cin >> c[i].first >> c[i].second; } sort(ALL(a)); sort(ALL(c)); c.push_back(make_pair(3 * N, 3 * N)); vector<int> used(N); int res = 0; for(int i = N -1; i >=0; --i){ int p = N; for(int j = 0; j < N; ++j) { if(used[j]) continue; if(a[i].first >= c[j].first || a[i].second >= c[j].second) continue; if(c[j].second < c[p].second) { p = i; } } if(p < N) { ++res; used[p] = true; } } cout << res << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 2D Plane 2N Points |
User | blue_jam |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 805 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example_0, example_1, example_2, example_3, example_4 |
All | example_0, example_1, example_2, example_3, example_4, line_0, line_1, line_2, line_3, maxrand_0, maxrand_1, maxrand_2, maxrand_3, maxrand_4, rand_0, rand_1, rand_2 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
example_0 | AC | 1 ms | 256 KB |
example_1 | AC | 1 ms | 256 KB |
example_2 | AC | 1 ms | 256 KB |
example_3 | AC | 1 ms | 256 KB |
example_4 | AC | 1 ms | 256 KB |
line_0 | AC | 1 ms | 256 KB |
line_1 | AC | 1 ms | 256 KB |
line_2 | AC | 1 ms | 256 KB |
line_3 | AC | 1 ms | 256 KB |
maxrand_0 | WA | 1 ms | 256 KB |
maxrand_1 | WA | 1 ms | 256 KB |
maxrand_2 | WA | 1 ms | 256 KB |
maxrand_3 | WA | 1 ms | 256 KB |
maxrand_4 | WA | 1 ms | 256 KB |
rand_0 | WA | 1 ms | 256 KB |
rand_1 | WA | 1 ms | 256 KB |
rand_2 | WA | 1 ms | 256 KB |