Submission #521828

# Submission time Handle Problem Language Result Execution time Memory
521828 2022-02-03T09:11:51 Z maks007 Easter Eggs (info1cup17_eastereggs) C++14
6 / 100
3 ms 456 KB
#include <bits/stdc++.h>
#include "grader.h"

using namespace std;

int findEgg (int N, vector < pair < int, int > > bridges)
{
	for(int i = 0; i < bridges.size(); i ++) {
		vector <int> q = {bridges[i].first, bridges[i].second};
		if(query(q)) {
			vector <int> ff, ss;
			ff.push_back(bridges[i].first);
			ss.push_back(bridges[i].second);
			if(query(ff)) return ff[0];
			else return ss[0];
		}
	}
}

Compilation message

eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:8: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]
    8 |  for(int i = 0; i < bridges.size(); i ++) {
      |                 ~~^~~~~~~~~~~~~~~~
eastereggs.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 200 KB Number of queries: 16
2 Partially correct 1 ms 200 KB Number of queries: 16
3 Partially correct 2 ms 200 KB Number of queries: 16
4 Partially correct 3 ms 200 KB Number of queries: 16
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 432 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 -