제출 #163400

#제출 시각아이디문제언어결과실행 시간메모리
163400davitmarg철로 (IOI14_rail)C++17
컴파일 에러
0 ms0 KiB
/*DavitMarg*/
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <bitset>
#include <stack>
#include <cassert>
#include <iterator>
#include <fstream>
#define mod 1000000007ll
#define LL long long
#define LD long double
#define MP make_pair
#define PB push_back
#define all(v) v.begin(), v.end()
using namespace std;

#ifndef death
#include "grader.h"
#endif

#ifdef death
int getDistance(int a, int b)
{
    cout << a << " : " << b << endl;
    cin >> a;
    return a;
}
#endif

void findLocation(int n, int POS, int location[], int stype[])
{
    location[0] = POS;
    stype[0] = 1;

    vector<pair<int, LL>> x;
    vector<pair<int, LL>> R, L;
    for (int i = 1; i < n; i++)
    {
        LL d = getDistance(0, i);
        x.PB(MP(i, d));
    }
    sort(all(x));
    R.PB(x[0]);
    for (int i = 1; i < x.size(); i++)
    {
        LL d = getDistance(R[0].first, x[i].first);
        if (d == x[i].second + R[0].second)
            R.PB(x[i]);
        else if (x[i].second == R[0].second + d)
            L.PB(x[i]);
        else
            assert(0);
    }
    for (int i = 0; i < R.size(); i++)
    {
        location[R[i].first] = POS + R[i].second;
        stype[R[i].first] = 2;
    }

    for (int i = 0; i < L.size(); i++)
    {
        LL d = R[0].second;
        location[L[i].first] = POS - (L[i].second - d - d + 1) + 1;
        stype[L[i].first] = 1;
    }
}

#ifdef death

int main()
{
    int N, FR = 0, LOC[102], TYP[102];
    cin >> N;
    findLocation(N, FR, LOC, TYP);
    for (int i = 0; i < N; i++)
    {
        cout << LOC[i] << " : " << TYP[i] << endl;
    }
    return 0;
}

#endif

/*
 
4
3
4
8
7
6
 
*/

컴파일 시 표준 에러 (stderr) 메시지

rail.cpp:26:10: fatal error: grader.h: No such file or directory
 #include "grader.h"
          ^~~~~~~~~~
compilation terminated.