| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 136791 | ekrem | Exhibition (JOI19_ho_t2) | C++98 | 157 ms | 6656 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define coc g[node][i]
#define sol (k+k)
#define sag (k+k+1)
#define orta ((bas+son)>>1)
#define mod 1000000007
#define inf 1000000009
#define N 1000005
using namespace std;
typedef long long ll;
typedef pair < int , int > ii;
int n, m, ind = 1, k, a[N], c[N], ne[N];
ii b[N];
set < ii > s;
int main(){
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
scanf("%d %d",&n ,&m);
for(int i = 1; i <= n; i++){
scanf("%d %d",&b[i].st ,&b[i].nd);
// s.insert(mp(b[i].nd, i));
// cout << b[i].nd << " ";
}
sort(b + 1, b + n + 1);
for(int i = 1; i <= n; i++)
s.insert(mp(b[i].nd, i));
ind = n;
for(int i = 1; i <= m; i++)
scanf("%d",a + i);
sort(a + 1, a + m + 1);
// reverse(a + 1, a + m + 1);
// cout << "geldi" << endl;
for(int i = m; i >= 1; i--){
while(ind >= 1 and b[ind].st > a[i]){
// cout << "geldi " << b[ind].nd << endl;
s.erase(mp(b[ind].nd, ind));
ind--;
}
if(!s.empty()){
ii ek = *s.rbegin();
// cout << ek.st << " buldum" << endl;
c[++k] = ek.st;
s.erase(ek);
}
}
printf("%d\n", k);
return 0;
}
컴파일 시 표준 에러 (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... | ||||
