제출 #202505

#제출 시각아이디문제언어결과실행 시간메모리
202505stefanbalaz2경찰관과 강도 (BOI14_coprobber)C++14
0 / 100
5 ms376 KiB
#include "coprobber.h" #include<bits/stdc++.h> #define pb push_back using namespace std; const int maxn=510; int dep[maxn],pos[maxn],e; vector<int>vect[maxn]; void go(int x,int prv,int dp){ dep[x]=dp; pos[x]=1; for(int i=0;i<vect[x].size();i++){ int id=vect[x][i]; if(id==prv)continue; if(pos[id] && dep[id]>dep[x])continue; if(pos[id] && dep[id]<dep[x]) if(dep[x]-dep[id]+1>3)e=1; if(pos[id])continue; go(id,x,dp+1); } } int start(int N, bool A[MAX_N][MAX_N]) { for(int i=0;i<N;i++) for(int j=0;j<N;j++) if(A[i][j])vect[i].pb(j); go(0,-1,1); if(e)return -1; return 0; } int nextMove(int R) { return -1; }

컴파일 시 표준 에러 (stderr) 메시지

coprobber.cpp: In function 'void go(int, int, int)':
coprobber.cpp:11:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<vect[x].size();i++){
                 ~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...