Submission #144625

#TimeUsernameProblemLanguageResultExecution timeMemory
144625emilemZagonetka (COI18_zagonetka)C++14
0 / 100
3 ms376 KiB
#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) { 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 (stderr)

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:28: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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...