This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
///~~~LOTA~~~///
#include "coprobber.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define append push_back
#define add insert
#define nl "\n"
#define ff first
#define ss second
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL)
#define N 500
int r;
int dept[N];
vector<int> g[N];
void dfs(int v){
for(auto& i:g[v]){
if(dept[i])
r=max(r,dept[v]-dept[i]);
else{
dept[i]=dept[v]+1;
dfs(i);
}
}
}
int start(int n, bool a[N][N]){
for(int i=0;i<n;i++)
for(int j=r=0;j<n;j++)
if(a[i][j]) g[i].append(j);
dept[0]=1;
dfs(0);
if(r>3) return -1;
return 0;
}
int nextMove(int v){
return -1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |