#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define int ll
#include "grader.h"
vector<int> roads[515];
int nextnode=1, val[515];
void dfs(int x){
val[x] = nextnode;
nextnode++;
for(int i:roads[x]){
if(!val[i]){
dfs(i);
}
}
}
int findEgg (int n, vector<pair<int,int>> bridges){
for(pair<int,int> i:bridges){
roads[i.first].push_back(i.second);
roads[i.second].push_back(i.first);
}
dfs(1);
/*
int low=1,high=n,mid;
while(low!=high){
mid = (low+high)/2;
vector<int> x;
for(int i=1;i<=mid;i++){
x.push_back(val[i]);
}
if(query(x)){
high = mid;
}
else{
low = mid+1;
}
}
*/
nextnode = 1;
for(int i=1;i<=n;i++){
roads[i].clear();
val[i] = 0;
}
return 0;//low;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
The found island is incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
The found island is incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |