제출 #1053788

#제출 시각아이디문제언어결과실행 시간메모리
1053788Ignut수천개의 섬 (IOI22_islands)C++17
5 / 100
22 ms11864 KiB
/* Ignut
started: 11.08.2024
now: 11.08.2024
████████████████████████████████████████████████████████████████████
████████████████████████████████    ████████████████████████████████
██████████████████████████████        ██████████████████████████████
██████      ██████████████████        ██████████████████      ██████
██████          ██████████████        ██████████████          ██████
██████      ██    ████████████        ████████████    ██      ██████
██████      ████    ██████████        ██████████    ████      ██████
██████      ████      ██████████    ██████████      ████      ██████
██████      ████      ██████████    ██████████    ██████      ██████
██████      ██████    ██████████    ██████████    ██████      ██████
██████      ██████    ████████        ████████    ██████      ██████
██████      ██████      ██████        ██████      ██████      ██████
██████      ████        ████            ████        ████      ██████
██████            ██████████    ████    ██████████            ██████
██████      ██      ██████    ████████    ██████      ██      ██████
██████      ██████            ████████            ██████      ██████
██████                    ██            ██                    ██████
██████████████████████      ████    ████      ██████████████████████
████████████████████████      ██    ██      ████████████████████████
██████████████████████████                ██████████████████████████
██████████████████████████████        ██████████████████████████████
████████████████████████████████████████████████████████████████████
*/

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

const int MAXN = 1e5 + 123;
int n;

vector<int> g[MAXN];
bool used[MAXN];

vector<int> order;

int cycle_start = -1;

bool ans = false;

void dfs(int v) {
    if (ans) return;
    // if (cycle_start != -1) return;
    used[v] = true;
    // order.push_back(v);
    if (g[v].size() >= 2) {
        ans = true; return;
    }
    for (int to : g[v]) {
        if (used[to]) {
            // cycle_start = to;
            // break;
            continue;
        }
        dfs(to);
    }
}

int cnt[MAXN] = {};

variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) {
    n = N;
    vector<int> vec[N];
    int ind[N][N];
    for (int i = 0; i < M; i ++) {
        g[U[i]].push_back(V[i]);
        vec[U[i]].push_back(i);
        ind[U[i]][V[i]] = i;
        // g[V[i]].push_back(U[i]);
    }
    if (n == 2) return false;
    vector<int> res;
    res.push_back(ind[0][1]);
    res.push_back(ind[1][0]);
    res.push_back(ind[0][2]);
    res.push_back(ind[2][0]);

    res.push_back(ind[1][0]);
    res.push_back(ind[0][1]);
    res.push_back(ind[2][0]);
    res.push_back(ind[0][2]);
    return res;
    // return (n == 2 ? false : true);
    // dfs(0);
    // return (ans ? false : true);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...