# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
257272 | 2020-08-04T03:22:11 Z | shrek12357 | Carnival (CEOI14_carnival) | C++14 | 7 ms | 384 KB |
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <map> #include <set> #include <climits> #include <cmath> #include <fstream> #include <queue> using namespace std; int n; int main() { cin >> n; vector<int> cur; cur.push_back(1); vector<int> place; vector<int> ans(n + 1); ans[1] = 1; for (int i = 1; i < n; i++) { cout << cur.size() + 1 << " "; for (int i = 0; i < cur.size(); i++) { cout << cur[i] << " "; } cout << i + 1 << endl; int temp; cin >> temp; if (temp == cur.size() + 1) { cur.push_back(i + 1); ans[i + 1] = i + 1; } else { place.push_back(i + 1); } } for (int i = 0; i < place.size(); i++) { int lo = 0; int hi = cur.size() - 1; while (lo < hi) { int mid = (lo + hi) / 2; cout << mid - lo + 2 << " "; for (int j = lo; j <= mid; j++) { cout << cur[j] << " "; } cout << place[i] << endl; int temp; cin >> temp; if (temp == mid - lo + 2) { lo = mid + 1; } else { hi = mid; } } ans[place[i]] = cur[lo]; } cout << 0 << " "; for (int i = 1; i < ans.size(); i++) { cout << ans[i] << " "; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 256 KB | Integer 19 violates the range [1, 11] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 384 KB | Integer 6 violates the range [1, 5] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Incorrect | 5 ms | 256 KB | Integer 11 violates the range [1, 8] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 256 KB | Integer 5 violates the range [1, 4] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 256 KB | Output is correct |
2 | Incorrect | 6 ms | 256 KB | Integer 20 violates the range [1, 17] |
3 | Halted | 0 ms | 0 KB | - |