# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
834896 | Username4132 | Thousands Islands (IOI22_islands) | C++17 | 52 ms | 21696 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "islands.h"
#include <variant>
#include<iostream>
#include <vector>
#include<cassert>
using namespace std;
using pii = pair<int, int>;
#define forn(i, n) for(int i=0; i<(int)n; ++i)
#define PB push_back
#define F first
#define S second
const int MAXN = 100010;
int n, m, cur, stpos[MAXN];
bool vis[MAXN], blocked[MAXN], inst[MAXN];
vector<int> st, se;
vector<pii> g[MAXN];
bool dfs2(int v){
inst[v]=true;
vis[v]=true;
for(pii to:g[v]) if(!vis[to.F] && !blocked[to.F]) {
bool ret = dfs2(to.F);
if(ret) return true;
}
else if((inst[to.F] || stpos[to.F]!=-1) && !blocked[to.F] && to.S != se[cur]){
return true;
}
inst[v]=false;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |