이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
void solve(){
int n, m;
cin >> n >> m;
vector<pi> a(n);
vi b(m);
for(int i = 0; i < n; i++)
cin >> a[i].s >> a[i].f;
for(int i = 0; i < m; i++)
cin >> b[i];
sort(a.begin(), a.end());
sort(b.begin(), b.end());
int j = m-1;
for(int i = n-1; i >= 0; i--){
if(a[i].s <= b[j])
j--;
if(j < 0)
break;
}
cout << m - j - 1 << '\n';
}
int main(){
//freopen("input.txt", "r", stdin);
//freopen("test.out", "w", stdout);
//ios::sync_with_stdio(0); cin.tie(0);
int t = 1;
//cin >> t;
while(t--){
solve();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |