# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
144627 | 2019-08-17T09:50:00 Z | emilem | Zagonetka (COI18_zagonetka) | C++14 | 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
# | 결과 | 실행 시간 | 메모리 | 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 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | Unexpected end of file - token expecte |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 296 KB | Unexpected end of file - token expecte |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Unexpected end of file - token expecte |
2 | Halted | 0 ms | 0 KB | - |