| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 516248 | thomas_li | Exhibition (JOI19_ho_t2) | C++17 | 1004 ms | 4896 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MM = 1e5+5;
int main(){
cin.tie(0)->sync_with_stdio(0);
int n,m,ans = 0; cin >> n >> m;
vector<array<int,2>> a; vector<int> b;
for(int i = 0; i < n; i++){
int s,v; cin >> s >> v;
a.push_back({s,v});
}
for(int i = 0; i < m; i++){
int c; cin >> c;
b.emplace_back(c);
}
sort(b.begin(),b.end());
sort(a.begin(),a.end());
auto solve = [&](int st){
priority_queue<int,vector<int>,greater<>> q;
for(int i = st, j = 0,lst = 0; i < m; i++){
while(j < n && a[j][0] <= b[i]){
if(lst <= a[j][1]) q.push(a[j][1]);
j++;
}
if(q.empty()) return 0;
lst = q.top();
q.pop();
}
return 1;
};
for(int i = 0; i < m; i++){
if(solve(i)){
cout << m-i << "\n";
return 0;
}
}
cout << "0\n";
}
// if ans = k, we should take k biggest frames
// we should put min value that fits in left frame, min value that fits into second left, ...
컴파일 시 표준 에러 (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... | ||||
