# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
98036 | 2019-02-20T01:54:05 Z | dndhk | None (JOI16_worst_reporter2) | C++14 | 2 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; const int MAX_N = 200000; int N; vector<pii> v1, v2; vector<pair<pii, int> > v; int cnt[MAX_N+1]; int ans; int main(){ scanf("%d", &N); ans = N; for(int i=0; i<N; i++){ int a, b; scanf("%d%d", &a, &b); v.push_back({{b, 0}, a}); }for(int i=0; i<N; i++){ int a, b; scanf("%d%d", &a, &b); v.push_back({{b, 1}, a}); } sort(v.begin(), v.end()); for(int i=v.size()-1; i>=0; i--){ pair<pii, int> now = v[i]; if(now.first.second==1){ cnt[now.second]++; }else{ if(cnt[now.second]>0){ cnt[now.second]--; ans--; } } } printf("%d", ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |