# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
251754 | jamielim | Exhibition (JOI19_ho_t2) | C++14 | 85 ms | 4472 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#include "lost.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;
typedef long double ld;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ALL(x) x.begin(),x.end()
#define SZ(x) (int)x.size()
const int INF=2012345678;
const ll LLINF=4012345678012345678LL;
const ll MOD=1000000007; //998244353; //
const ld PI=3.1415926535898;
const ld EPS=1e-9;
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(b==0)return a;return gcd(b,a%b);}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline ll expo(ll b,ll p,ll m){ll res=1; while(p){if(p&1)res=(res*b)%m; b=(b*b)%m; p>>=1;} return res;}
inline ll modinv(ll a,ll m){return expo(a,m-2,m);}
int main(){
int n,m;
scanf("%d%d",&n,&m);
ii p[n];
for(int i=0;i<n;i++)scanf("%d%d",&p[i].se,&p[i].fi);
int c[m];
for(int i=0;i<m;i++)scanf("%d",&c[i]);
sort(p,p+n);sort(c,c+m);
int l=0,r=min(n,m);
while(l<r){
int mid=(l+r+1)/2;
int idx=0;
bool poss=1;
for(int i=m-mid;i<m;i++){
while(idx<n&&p[idx].se>c[i])idx++;
if(idx==n){poss=0;break;}
idx++;
}
if(poss)l=mid;
else r=mid-1;
}
printf("%d",l);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |