Submission #149760

#TimeUsernameProblemLanguageResultExecution timeMemory
149760Greedy left the chat. (#200)Bulb Game (FXCUP4_bulb)C++17
36 / 100
1051 ms10140 KiB
#include "bulb.h" #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #include<bits/stdc++.h> #define rc(x) return cout<<x<<endl,0 #define pb push_back #define mkp make_pair #define in insert #define er erase #define fd find #define fr first #define sc second typedef long long ll; typedef long double ld; const ll INF=0x3f3f3f3f3f3f3f3f; const ll llinf=(1LL<<61); const int inf=(1<<30); const int nmax=3e5+50; const int mod=1e9+7; using namespace std; int n,t,i,j,b,s[nmax],l[nmax],r[nmax]; int dfs(int x) { if(x<0)return x; if(s[x])return dfs(r[x]); else return dfs(l[x]); } int FindWinner(int T,vector<int> L,vector<int> R) { n=L.size(),t=T; for(i=0;i<n;i++) { l[i]=L[i]; r[i]=R[i]; } for(i=0;i<n;i++) { s[i]^=1; b=0; for(j=0;j<n;j++) { s[j]^=1; if(dfs(0)==-2) { b=1; s[j]^=1; break; } s[j]^=1; } if(!b)return 1; s[i]^=1; } return 0; }

Compilation message (stderr)

bulb.cpp:3:0: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
 #pragma GCC optimization("O3")
 
bulb.cpp:4:0: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
 #pragma GCC optimization("unroll-loops")
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...