# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
321451 | tjdgus4384 | 장애물 경기 (KOI16_dd) | C++14 | 94 ms | 6848 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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++;
컴파일 시 표준 에러 (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... |