제출 #1344087

#제출 시각아이디문제언어결과실행 시간메모리
1344087mxhrvsSocial Engineering (EGOI22_socialengineering)C++20
컴파일 에러
0 ms0 KiB
#include <vector>
#include <algorithm>
#include "social.h" 

using namespace std;

const int MAXN = 200005;
vector<int> adj[MAXN];
int matching[MAXN];
bool visited[MAXN];

bool dfs_match(int u) {
    visited[u] = true;
    for (int v : adj[u]) {
        if (v == 1) continue; 
        int w = matching[v];
        if (w == 0 || (!visited[w] && dfs_match(w))) {
            matching[v] = u;
            matching[u] = v;
            return true;
        }
    }
    return false;
}

void SocialEngineering(int n, int m, vector<pair<int, int>> edges) {
    for (int i = 1; i <= n; i++) adj[i].clear(), matching[i] = 0;
    for (auto e : edges) {
        adj[e.first].push_back(e.second);
        adj[e.second].push_back(e.first);
    }

    for (int i = 2; i <= n; i++) {
        if (matching[i] == 0) {
            for (int j = 1; j <= n; j++) visited[j] = false;
            dfs_match(i);
        }
    }

    
    while (true) {
        int v = GetMove(); 
        if (v == 0) break; 
        
        int my_reply = matching[v];
        
        if (my_reply == 0) {
            return; 
        }
        
        MakeMove(my_reply);
    }
}

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

Main.cpp:3:10: fatal error: social.h: No such file or directory
    3 | #include "social.h"
      |          ^~~~~~~~~~
compilation terminated.