Submission #521901

# Submission time Handle Problem Language Result Execution time Memory
521901 2022-02-03T12:03:35 Z maks007 Easter Eggs (info1cup17_eastereggs) C++14
10 / 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 = 0; 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;
		}
	}
}

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 = 0; i < bridges.size(); i ++) {
      |                 ~~^~~~~~~~~~~~~~~~
eastereggs.cpp:8:23: warning: control reaches end of non-void function [-Wreturn-type]
    8 |  vector <int> used(N+1);
      |                       ^
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 200 KB Number of queries: 15
2 Partially correct 1 ms 200 KB Number of queries: 15
3 Partially correct 2 ms 200 KB Number of queries: 15
4 Partially correct 1 ms 200 KB Number of queries: 15
# 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 6
2 Halted 0 ms 0 KB -