Submission #98249

# Submission time Handle Problem Language Result Execution time Memory
98249 2019-02-21T17:12:02 Z Vasiljko Easter Eggs (info1cup17_eastereggs) C++14
0 / 100
4 ms 540 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;

typedef long long ll;
const ll MOD = 1e9+7;

int n,cnt,ans;
vector<int>v[550];

void dfs(int s,int p){
    cnt++;
    if(ans)return;
    if(cnt==n&&!ans){
        ans=s;
        return;
    }
    vector<int>t;
    t.push_back(s);
    if(query(t)){
        ans=s;
        return;
    }
    for(auto e:v[s])if(e!=p)dfs(e,s);
}

int findEgg(int N,vector<pair<int,int> >b){
    n=N;
    for(int i=0;i<n;i++)v[i].clear();
    for(auto e:b){
        v[e.first].push_back(e.second);
        v[e.second].push_back(e.first);
    }
    ans=0;
    dfs(1,0);

    return ans;
}
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 540 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -