Submission #822973

# Submission time Handle Problem Language Result Execution time Memory
822973 2023-08-12T06:20:14 Z Darren0724 Easter Eggs (info1cup17_eastereggs) C++17
0 / 100
1 ms 464 KB
#include <bits/stdc++.h>
#include "grader.h"

using namespace std;
vector<int> v;
vector<vector<int>> adj;
void dfs(int k,int pa){
    v.push_back(k);
    for(int j:adj[k]){
        if(j==pa)continue;
        dfs(j,k);
    }
}
int findEgg (int n, vector<pair<int,int>> bridges)
{
    v.clear();
    adj.clear();
    adj.resize(n+1);
    for(auto [a,b]:bridges){
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    int l=0,r=n;
    while(r-l>1){
        int m=(l+r)>>1;
        vector<int> a(v.begin(),v.begin()+m);
        if(query(a)){
            r=m;
        }
        else{
            l=m;
        }
    }
    return v[l];
    
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 336 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 336 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 464 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -