# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1044091 | 2024-08-05T07:18:31 Z | vjudge1 | Zagonetka (COI18_zagonetka) | C++17 | 1 ms | 344 KB |
#include<bits/stdc++.h> using namespace std; void print(vector<int> v) { for(int i = 0; i + 1 < v.size(); i++) cout << v[i]; cout << v.back() << endl; } bool ask(vector<int> v) { cout << "query "; print(v); bool res; cin >> res; return res; } void out(vector<int> a, vector<int> b) { cout << "end\n"; print(a); print(b); exit(0); } int main() { int n; cin >> n; vector<int> p(n), a, b; for(int i = 0; i < n; i ++) cin >> p[i]; a = b = p; sort(p.begin(), p.end()); do { bool res = ask(p); if(res) a = min(a, p), b = max(a, p); } while(next_permutation(p.begin(), p.end())); out(a, b); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 344 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 344 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 344 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 344 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |