답안 #228034

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
228034 2020-04-29T15:35:24 Z AaronNaidu Simurgh (IOI17_simurgh) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include <"simurgh.h">
using namespace std;

int n;
vector<int> u, v;
vector<int> graph[600];
vector<int> subset, toRet;
bool visited[600];


void DFS(int node) {
    visited[node] = true;
    for (auto i : graph[node])
    {
        if (!visited[i])
        {
            DFS(i);
        }
        
    }
    
}

void getSubset(int used, int pos) {
    if (used == n-1)
    {
        for (auto i : subset)
        {
            graph[u[i]].push_back(v[i]);
            graph[v[i]].push_back(u[i]);
        }
        DFS(0);
        bool allRight = true;
        for (int i = 0; i < n; i++)
        {
            if (!visited[i])
            {
                allRight = false;
            }
        }
        if (allRight)
        {
            if (count_common_roads(subset) == n-1)
            {
                toRet = subset;
            }
        }
        for (int i = 0; i < n; i++)
        {
            visited[i] = false;
            graph[i].clear();
        }
        
        return;
    }

    if (pos >= u.size())
    {
        return;
    }
    
    for (int i = pos; i < u.size(); i++)
    {
        subset.push_back(i);
        getSubset(used+1, i+1);
        subset.pop_back();
    }
    
}

vector<int> find_roads(int ln, vector<int> lu, vector<int> lv) {
    n = ln;
    u = lu;
    v = lv;
    
    getSubset(0, 0);
    return toRet;
}

Compilation message

simurgh.cpp:2:10: fatal error: "simurgh.h": No such file or directory
 #include <"simurgh.h">
          ^~~~~~~~~~~~~
compilation terminated.