제출 #398932

#제출 시각아이디문제언어결과실행 시간메모리
398932almothana05Cop and Robber (BOI14_coprobber)C++14
0 / 100
66 ms1728 KiB
#include "coprobber.h"
#include<iostream>
#include<vector>
#include<algorithm>
 
using namespace std;
int menge = 0 , jet = 0 , r = 0;
	int cmp = 0 ;
bool done = 0;
vector<vector<int> >num ;
vector<vector<bool> >  a;
vector<int >vis(500+10 , 0), comp;
 
int start(int N, bool A[MAX_N][MAX_N])
{
	int re = 0 , erge = 0;
	for(int i =  0 ;i < N ; i++){
		re = 0;
		a.push_back(vector<bool>());
		num.push_back(vector<int>());
		for(int  j = 0 ; j < N  ; j++){
			a[i].push_back(A[i][j]);
			if(a[i][j] == 1){
				num[i].push_back(j);
				re++;
			}
		}
		if(re == 1){
			erge = i;
		}
	}
	menge = N;
	jet = erge;
    return erge;
}
 
int nextMove(int R)
{
    if(R == jet){
        return jet;
    }
		for(int i =  0 ; i < menge ; i++){
			if(vis[i] == 0 && a[jet][i] == 1){
				vis[i] = 1;
				jet = i;
				return i;
			}
		}
	
}

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

coprobber.cpp: In function 'int nextMove(int)':
coprobber.cpp:50:1: warning: control reaches end of non-void function [-Wreturn-type]
   50 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...