답안 #521886

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
521886 2022-02-03T11:12:16 Z boykut Easter Eggs (info1cup17_eastereggs) C++14
6 / 100
2 ms 456 KB
#include <bits/stdc++.h>
#include "grader.h"

using namespace std;

int findEgg (int N, vector < pair < int, int > > bridges){

	vector<int> par(1 + N);
	vector<vector<int>> g(1 + N);
	for (auto it : bridges) {
		int a, b;
		tie(a, b) = it;
		g[a].push_back(b);
		g[b].push_back(a);
	}

	random_shuffle(bridges.begin(), bridges.end());

	for (auto it : bridges) {
		int a, b;
		tie(a, b) = it;
		if (query(vector<int>{a, b}) == 1) {
			if (query(vector<int>{a}))
				return a;
			return b;
		}
	}
	return -1;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 200 KB Number of queries: 14
2 Partially correct 2 ms 200 KB Number of queries: 14
3 Partially correct 2 ms 200 KB Number of queries: 15
4 Partially correct 2 ms 200 KB Number of queries: 16
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 440 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 456 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -