# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48965 | 2018-05-20T15:40:34 Z | doowey | Carnival (CEOI14_carnival) | C++14 | 10 ms | 584 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef long double ld; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define TEST freopen("in.txt","r",stdin); #define ab(a) ((a < 0) ? (-(a)) : (a)) #define all(a) a.begin(), a.end() int Query(vector<int>party){ cout << party.size() << " "; for(auto x : party) cout << x << " "; cout << endl; int answer; cin >> answer; return answer; } const int N = 155; int ans[N]; int main(){ int n; cin >> n; vector<int>unique; unique.push_back(1); ans[1] = 1; int p = 2; vector<int>QR; for(int i = 2;i <= n;i ++){ QR = unique; QR.push_back(i); if(Query(QR) < QR.size()){ int lf = 0,rf = unique.size() + 1; int md; int rez; while(lf + 1 < rf){ md = (lf + rf) / 2; QR.clear(); for(int i = 0;i < md;i ++) QR.push_back(unique[i]); QR.push_back(i); if(Query(QR) < QR.size()) rf = md; else lf = md; } ans[i] = rf; } else{ ans[i] = p; ++p; unique.push_back(i); } } cout << "0 "; for(int i = 1;i <= n;i ++) cout << ans[i] << " "; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 248 KB | Output is correct |
2 | Correct | 9 ms | 308 KB | Output is correct |
3 | Correct | 5 ms | 424 KB | Output is correct |
4 | Correct | 5 ms | 564 KB | Output is correct |
5 | Correct | 6 ms | 564 KB | Output is correct |
6 | Correct | 5 ms | 564 KB | Output is correct |
7 | Correct | 10 ms | 564 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 564 KB | Output is correct |
2 | Correct | 8 ms | 564 KB | Output is correct |
3 | Correct | 7 ms | 568 KB | Output is correct |
4 | Correct | 6 ms | 568 KB | Output is correct |
5 | Correct | 7 ms | 568 KB | Output is correct |
6 | Correct | 7 ms | 568 KB | Output is correct |
7 | Correct | 6 ms | 568 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 568 KB | Output is correct |
2 | Correct | 9 ms | 568 KB | Output is correct |
3 | Correct | 7 ms | 568 KB | Output is correct |
4 | Correct | 5 ms | 568 KB | Output is correct |
5 | Correct | 4 ms | 568 KB | Output is correct |
6 | Correct | 4 ms | 568 KB | Output is correct |
7 | Correct | 7 ms | 568 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 568 KB | Output is correct |
2 | Correct | 7 ms | 568 KB | Output is correct |
3 | Correct | 7 ms | 568 KB | Output is correct |
4 | Correct | 4 ms | 568 KB | Output is correct |
5 | Correct | 8 ms | 568 KB | Output is correct |
6 | Correct | 7 ms | 568 KB | Output is correct |
7 | Correct | 9 ms | 568 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 568 KB | Output is correct |
2 | Correct | 8 ms | 568 KB | Output is correct |
3 | Correct | 8 ms | 568 KB | Output is correct |
4 | Correct | 10 ms | 580 KB | Output is correct |
5 | Correct | 5 ms | 584 KB | Output is correct |
6 | Correct | 8 ms | 584 KB | Output is correct |
7 | Correct | 6 ms | 584 KB | Output is correct |