Submission #446515

# Submission time Handle Problem Language Result Execution time Memory
446515 2021-07-22T09:12:04 Z ritul_kr_singh Easter Eggs (info1cup17_eastereggs) C++17
0 / 100
1 ms 472 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;

vector<int> g[513];
int t[512], dfsTimer;

void dfs(int u, int p){
	t[dfsTimer++] = u;
	for(int v : g[u]) if(v != p) dfs(v, u);
}

int findEgg (int n, vector <pair<int, int>> e){
	for(int i=0; i<n; ++i) g[i].clear();
	dfsTimer = 0;
	
	for(auto &[u, v] : e){
		g[u].push_back(v);
		g[v].push_back(u);
	}

	dfs(1, 1);

	int x = 0;
	for(int y=512; y/=2; ){
		if(x + y <= n){
			vector<int> q(x+y);
			for(int j=0; j<x+y; ++j) q[j] = t[j];
			x += y * !query(q);
		}
	}

	return t[x];
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 456 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 456 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 472 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -