Submission #633661

#TimeUsernameProblemLanguageResultExecution timeMemory
633661flappybirdThousands Islands (IOI22_islands)C++17
8.40 / 100
54 ms11832 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; #define MAX 101010 int deg[MAX]; vector<int> adj[MAX]; vector<int> radj[MAX]; int chk[MAX]; int N, M; variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { int i; ::N = N; ::M = M; for (i = 0; i < M; i++) deg[U[i]]++, adj[U[i]].push_back(V[i]), radj[V[i]].push_back(U[i]); queue<int> q; for (i = 0; i < N; i++) if (!deg[i]) q.push(i); while (q.size()) { int t = q.front(); q.pop(); chk[t] = 1; for (auto v : radj[t]) if (!chk[v]) { deg[v]--; if (deg[v] == 0) q.push(v); } } if (chk[0]) return false; else return vector<int>({ 4, 6, 3, 4 }); }
#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...