# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
321451 | tjdgus4384 | 장애물 경기 (KOI16_dd) | C++14 | 94 ms | 6848 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int N, x, y, a, b, c;
set<pair<int, long long> > s;
vector<pair<int, pair<int, int> > > v;
int main(){
scanf("%d", &N);
scanf("%d %d", &x, &y);
s.insert({x, 0});
for(int i = 0;i < N;i++){
scanf("%d %d %d", &a, &b, &c);
v.push_back({a, {b, c}});
}
sort(v.begin(), v.end());
for(int i = 0;i < N;i++){
a = v[i].first;
b = v[i].second.first;
c = v[i].second.second;
set<pair<int, long long> >::iterator it;
it = s.lower_bound({b+1, 0});
vector<pair<int, long long> > m1, m2;
while(it != s.end()){
int yt = (*it).first;
if(yt >= c) break;
long long len = (*it).second;
m1.push_back({b, len+(long long)yt-(long long)b});
m2.push_back({c, len+(long long)c-(long long)yt});
set<pair<int, long long> >::iterator tmp = it;
it++;
Compilation message (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... |