| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 730160 | ogibogi2004 | Rail (IOI14_rail) | C++14 | 83 ms | 700 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rail.h"
#include<bits/stdc++.h>
using namespace std;
void findLocation(int N, int first, int location[], int stype[])
{
    location[0]=first;
    stype[0]=1;
    vector<pair<int,int> >distances;
    vector<int>dist_by_ind(N);
    for(int i=1;i<N;i++)
    {
        distances.push_back({getDistance(0, i),i});
        dist_by_ind[i]=distances.back().first;
    }
    sort(distances.begin(),distances.end());
    location[distances[0].second]=location[0]+distances[0].first;
    stype[distances[0].second]=2;
    set<int>cs;
    set<int>ds;
    int minc=0,maxd=distances[0].second;
    cs.insert(location[0]);
    ds.insert(location[distances[0].second]);
    for(int i=1;i<distances.size();i++)
    {
        int j=distances[i].second;
        int disl=getDistance(j,minc);
        int disr=getDistance(j,maxd);
        if(dist_by_ind[minc]+disl<dist_by_ind[maxd]+disr)
        {
            //then next is D, it might be to the right of maxd or to the left
            //if dist(minc,maxd)>disl => its between L and R
            //otherwise it is after R
            if(location[maxd]-location[minc]>disl)
            {
                //=> L( k) R)
                location[j]=location[minc]+disl;
                stype[j]=2;
            }
            else
            {
                location[j]=location[minc]+disl;
                stype[j]=2;
                //=> L( R) k)
            }
        }
        else
        {
            if(location[maxd]-location[minc]>disr)
            {
                location[j]=location[maxd]-disr;
                stype[j]=1;
                //=> k( L( R)
            }
            else
            {
                location[j]=location[maxd]-disr;
                stype[j]=1;
                //=> L( k) R)
            }
        }
    }
    for(int i=0;i<N;i++)
    {
        cout<<i<<": "<<location[i]<<" "<<stype[i]<<endl;
    }
}
컴파일 시 표준 에러 (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... | ||||
