# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
144625 | 2019-08-17T09:49:05 Z | emilem | Zagonetka (COI18_zagonetka) | C++14 | 3 ms | 376 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) { 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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 248 KB | Output is correct |
3 | Incorrect | 3 ms | 376 KB | Output isn't correct |
4 | 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 | - |
# | 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 | 248 KB | Unexpected end of file - token expecte |
2 | Halted | 0 ms | 0 KB | - |