Submission #722665

#TimeUsernameProblemLanguageResultExecution timeMemory
722665bin9638Thousands Islands (IOI22_islands)C++17
0 / 100
34 ms7624 KiB
#include <bits/stdc++.h> #ifndef SKY #include "islands.h" #endif // SKY using namespace std; #define N 100010 #define ll long long #define fs first #define sc second #define ii pair<int,int> #define pb push_back int n,m,ktr[N]; vector<int>g[N]; void DFS(int u) { ktr[u]=1; for(auto v:g[u]) if(ktr[v]==0) DFS(v); } #ifdef SKY vector<int> #endif // SKY #ifndef SKY variant<bool, vector<int>> #endif // SKY find_journey(int NNN, int MMM, vector<int> canh_fs, vector<int> canh_sc) { n=NNN; m=MMM; for(int i=0;i<m;i++) { int u=canh_fs[i],v=canh_sc[i]; g[u].pb(v); g[v].pb(u); } if(n==2) { if(g[0].size()>=2&&g[1].size()>=2) { return #ifdef SKY {1}; #endif // SKY #ifndef SKY true; #endif // SKY }else { return #ifdef SKY {0}; #endif // SKY #ifndef SKY false; #endif // SKY } } if(g[0].size()>=2) { return #ifdef SKY {1}; #endif // SKY #ifndef SKY true; #endif // SKY } DFS(0); for(int i=1;i<n;i++) if(ktr[i]==1&&g[i].size()>=3) { return #ifdef SKY {1}; #endif // SKY #ifndef SKY true; #endif // SKY } return #ifdef SKY {0}; #endif // SKY #ifndef SKY false; #endif // SKY } #ifdef SKY int main() { freopen("A.inp","r",stdin); freopen("A.out","w",stdout); ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); return 0; } #endif
#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...