답안 #319752

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
319752 2020-11-06T11:13:07 Z northlake 기지국 (IOI20_stations) C++17
컴파일 오류
0 ms 0 KB
#include<stations.h>
#include<bits/sdtc++.h>

using namespace std;

vector<int> label(int n, int k, vector<int> u, vector<int> v) {
    // create adjacency list
    vector<int> adjacency_list[n] = {};
    for (int i = 0; i < n-1; i++) {
        int fnode = u[i]; int snode = v[i];
        adjacency_list[fnode].push_back(snode); adjacency_list[snode].push_back(fnode);
    }

    // find origin
    int origin;
    for (int i = 0; i < n; i++) {
        if (adjacency_list[i].size() == 1) {
            origin = i;
            break;
        }
    }

    // create labels
    vector<int> labels(n);
    bool visited[n] {false};
    int counter = 0;
    int current_node = origin;
    while (counter < n) {
        visited[current_node] = true;
        labels[current_node] = counter;
        counter += 1;
        for (auto neighbor : adjacency_list[current_node]) {
            if (!visited[neighbor]) {
                current_node = neighbor;
                break;
            }
        }
    }
    return labels;
}

int find_next_station(int s, int t, vector<int> c) {
    if (t > s) return *max_element(c.begin(), c.end());
    else return *min_element(c.begin(), c.end());
}

Compilation message

stations.cpp:2:9: fatal error: bits/sdtc++.h: No such file or directory
    2 | #include<bits/sdtc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.