| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1318564 | g31nius | Easter Eggs (info1cup17_eastereggs) | C++20 | 0 ms | 0 KiB |
query ( vector <int> h ) {
cnt++;
if ( h.empty() ) {
return 0;
}
for ( i = 1; i <= n; i++ ) {
ap[i] = 0;
}
for ( auto it = h.begin(); it != h.end(); it++ ) {
ap[*it] = 1;
}
queue <int> cc;
cc.push ( h[0] );
ap[h[0]] = 2;
while ( !cc.empty() ) {
int nod = cc.front();
cc.pop();
for ( auto it = v[nod].begin(); it != v[nod].end(); it++ ) {
if ( ap[*it] == 1 ) {
ap[*it] = 2;
cc.push ( *it );
}
}
}
for ( i = 1; i <= n; i++ ) {
if ( ap[i] == 1 ) {
return -1;
}
}
for ( auto it: h ) {
if ( it == x ) {
return 1;
}
}
return 0;
}
findEgg ( int n, vector < pair <int, int> > bridges ) {
if ( query ( {1} ) == 1 ) {
return 1;
}
return 0;
}
