Submission #144627

# Submission time Handle Problem Language Result Execution time Memory
144627 2019-08-17T09:50:00 Z emilem Zagonetka (COI18_zagonetka) C++14
9 / 100
10 ms 380 KB
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

template<typename T>
ostream& operator<<(ostream& ostr, const vector<T>& a)
{
	for (int i = 0; i < a.size(); ++i)
		ostr << a[i] << ' ';
	return ostr;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int n;
	cin >> n;
	vector<int> p(n);
	for (int i = 0; i < n; ++i)
		cin >> p[i];
	if (n <= 6)
	{
		for (int i = 0; i < n; ++i)
			p[i] = i + 1;
		vector<int> smallest, largest;
		do {
			cout << "query " << p << endl;
			int res;
			cin >> res;
			if (res && smallest.empty())
				smallest = p;
			if (res)
				largest = p;
		} while (next_permutation(p.begin(), p.end()));
		cout << "end\n" << smallest << '\n' << largest << endl;
		return 0;
	}
}

Compilation message

zagonetka.cpp: In instantiation of 'std::ostream& operator<<(std::ostream&, const std::vector<T>&) [with T = int; std::ostream = std::basic_ostream<char>]':
zagonetka.cpp:30:24:   required from here
zagonetka.cpp:9:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < a.size(); ++i)
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 3 ms 252 KB Output is correct
3 Correct 3 ms 248 KB Output is correct
4 Correct 4 ms 248 KB Output is correct
5 Correct 10 ms 376 KB Output is correct
6 Correct 8 ms 380 KB Output is correct
7 Correct 9 ms 248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB Unexpected end of file - token expecte
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 296 KB Unexpected end of file - token expecte
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Unexpected end of file - token expecte
2 Halted 0 ms 0 KB -