Submission #1239670

#TimeUsernameProblemLanguageResultExecution timeMemory
1239670AlperenT_Thousands Islands (IOI22_islands)C++20
0 / 100
28 ms28744 KiB
#include "islands.h" #include <variant> #include <vector> #include <bits/stdc++.h> //#include "segments.h" #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2") #define pb push_back #define F first #define pii pair<int,int> #define all(a) a.begin(),a.end() #define S second #define sz(a) (int)a.size() #define rep(i , a , b) for(int i = (a) ; i <= (b) ; i++) #define per(i , a , b) for(int i = (a) ; i >= (b) ; i--) #define ld double #define ll long long using namespace std ; const int maxn = 1e6 + 10 , inf = 1e9+ 10 , mod = 998244353; int mark[maxn] ; vector <pii> G[maxn] ; std::variant<bool, std::vector<int>> find_journey(int n, int m, std::vector<int> U, std::vector<int> V) { rep(i , 0 ,m-1){ G[U[i]].pb({V[i] , i}); } bool ok =0; vector <int> vec ; int v = 0; while(sz(G[v]) <= 2){ vec.pb(v) ; if(sz(G[v]) ==0)return false ; v = G[v][0].F ; if(mark[v] == 1){ok = 1;break;} mark[v] = 1; } return 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...