Submission #235260

#TimeUsernameProblemLanguageResultExecution timeMemory
235260GoolakhCop and Robber (BOI14_coprobber)C++17
Compilation error
0 ms0 KiB
/// Be Kind :) #include <bits/stdc++.h> #include "coprobber.h" using namespace std; #pragma GCC optimize("O2") #pragma GCC optimize("unroll-loops") //#pragma GCC optimize("Os") /* Bitch, where you when I was walkin'? Now I run the game, got the whole world talkin' */ /* You never likes us anyway, fuck your friendship, I meant it */ /* The Chanel or Balenciaga, Louis and Vuitton She know I got Fendi, Prada when I hit Milan */ /* Niggas been counting me out I'm counting my bullets, I'm loading my clips I'm writing down names, I'm making a list */ /* I ran away, I don't think I'm coming back home */ #define F first #define S second #define pb push_back #define SZ(x) (ll)(x.size()) #define all(x) x.begin(),x.end() typedef int ll; typedef pair<ll,ll> pll; //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const ll maxn=5e2+10, maxm=51, lg=23, mod=1e9+7, inf=1e18; ll n,cur; bool g[maxn][maxn],win[maxn][maxn]; ll cnt[maxn][maxn],nxt[maxn][maxn]; ll tg[maxn]; ll start(ll N,bool A[MAX_N][MAX_N]){ n=N; for(int i=0;i<n;i++){ tg[i]=0; for(int j=0;j<n;j++){ g[i][j]=A[i][j]; tg[i]+=g[i][j]; cnt[i][j]=0; } } deque<pair<ll,pll>> q; for(int i=0;i<n;i++){ q.pb({0,{i,i}}); q.pb({1,{i,i}}); win[i][i]=1; } while(!q.empty()){ auto v=q.front(); q.pop_front(); if(v.F==1){ for(int i=0;i<n;i++)if(g[i][v.S.F] || i==v.S.F)if(!win[i][v.S.S]){ win[i][v.S.S]=1; nxt[i][v.S.S]=v.S.F; q.pb({0,{i,v.S.S}}); } } if(v.F==0){ for(int i=0;i<n;i++)if(g[i][v.S.S]){ cnt[v.S.F][i]++; if(cnt[v.S.F][i]==tg[i]) q.pb({1,{v.S.F,i}}); } } } } ll next_move(ll r){ return cur=nxt[cur][r]; } /* int main(){ ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); return 0; } */

Compilation message (stderr)

coprobber.cpp:35:54: warning: overflow in implicit constant conversion [-Woverflow]
 const ll maxn=5e2+10, maxm=51, lg=23, mod=1e9+7, inf=1e18;
                                                      ^~~~
coprobber.cpp: In function 'll start(ll, bool (*)[500])':
coprobber.cpp:74:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
/tmp/ccrUKaMp.o: In function `main':
grader.cpp:(.text.startup+0x1f8): undefined reference to `nextMove(int)'
collect2: error: ld returned 1 exit status