Submission #1235622

#TimeUsernameProblemLanguageResultExecution timeMemory
1235622Ghulam_JunaidThousands Islands (IOI22_islands)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "islands.h"
#include "grader.cpp"
using namespace std;

const int N = 2e5 + 10;
int n, m, vis[N];
vector<int> g[N], V;

bool dfs(int v, int day){
    if (v == 0) return 1;

    vis[v] = day;
    bool ans = 0;
    for (int e : g[v]){
        int u = V[e];
        if (vis[u] == day) return 1;
        ans |= dfs(u, day);
    }
    return ans;
}

variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> vv) {
    V = vv;
    n = N, m = M;
    for (int i = 0; i < m; i ++){
        g[U[i]].push_back(i);
    }
    int day = 0, ans = 0;
    for (int e : g[0]){
        day++;
        ans += dfs(V[e], day);
    }
    if (ans >= 2) return true;
    return false;
    
    if (N == 4) {
    return vector<int>({0, 1, 2, 4, 0, 3, 2, 1, 4, 3});
    }
    return false;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccBwRg7I.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccf2NyHj.o:islands.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status