# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
945936 | siewjh | 새 집 (APIO18_new_home) | C++17 | 5062 ms | 55728 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e18;
int main(){
int nums, types, queries; cin >> nums >> types >> queries;
vector<ll> loc(nums), typ(nums);
vector<multiset<ll>> vloc(types + 1);
for (int t = 1; t <= types; t++){
vloc[t].insert(-inf); vloc[t].insert(inf);
}
vector<tuple<ll, int, bool>> events;
for (int i = 0; i < nums; i++){
ll a, b; cin >> loc[i] >> typ[i] >> a >> b;
events.push_back({a, i, 1});
events.push_back({b + 1, i, 0});
}
sort(events.begin(), events.end());
vector<tuple<ll, ll, int>> qlist(queries);
vector<ll> ans(queries);
for (int q = 0; q < queries; q++){
ll l, y; cin >> l >> y;
qlist[q] = {y, l, q};
}
sort(qlist.begin(), qlist.end());
int curr = 0;
for (auto &[y, x, q] : qlist){
while (curr != events.size() && get<0>(events[curr]) <= y){
ll yr; int ind; bool b; tie(yr, ind, b) = events[curr]; curr++;
if (b) vloc[typ[ind]].insert(loc[ind]);
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |