Submission #1041273

#TimeUsernameProblemLanguageResultExecution timeMemory
1041273elotelo966Game (IOI14_game)C++17
0 / 100
0 ms348 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> #include "game.h" using namespace std; #define OYY LLONG_MAX #define mod 998244353 #define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define FOR for(int i=1;i<=n;i++) #define mid (start+end)/2 #define lim 200005 #define fi first #define se second int dizi[lim]; set<int> st; void initialize(int n) { for(int i=0;i<n;i++){ st.insert(i); dizi[i]=2; } } int hasEdge(int u, int v) { if(st.size()==1)return 0; else if(dizi[u]==2 && dizi[v]==2){ dizi[u]--; dizi[v]--; st.erase(u); st.erase(v); return 1; } else if((dizi[u]==2 || dizi[v]==2) && (dizi[u]!=0 && dizi[v]!=0)){ dizi[u]--; dizi[v]--; st.erase(u); st.erase(v); return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...