Submission #521905

# Submission time Handle Problem Language Result Execution time Memory
521905 2022-02-03T12:13:08 Z maks007 Easter Eggs (info1cup17_eastereggs) C++14
16 / 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> used(N+1);
	for(int i = 1; i < bridges.size(); i ++) {
		vector <int> q = {bridges[i].first, bridges[i].second};
		if(query(q)) {
			if(!used[q[0]] and !used[q[1]]) {
				vector <int> ff = {q[0]};
				vector <int> ss = {q[1]};
				if(query(ff)) return q[0];
				else return q[1];
			}
			if(used[q[0]]) return q[1];
			else return q[0]; 
		}else {
			used[q[0]] = 1;
			used[q[1]] = 1;
		}
	}
	int i = 0;
	if(used[bridges[i].first]) return bridges[i].second;
	else return bridges[i].first;
}

Compilation message

eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:9:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for(int i = 1; i < bridges.size(); i ++) {
      |                 ~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 200 KB Number of queries: 14
2 Partially correct 1 ms 200 KB Number of queries: 14
3 Partially correct 1 ms 200 KB Number of queries: 14
4 Partially correct 2 ms 200 KB Number of queries: 14
# Verdict Execution time Memory Grader output
1 Runtime error 2 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 6
2 Halted 0 ms 0 KB -