# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
475703 | 2021-09-23T17:24:22 Z | ZaZo_ | 사육제 (CEOI14_carnival) | C++14 | 10 ms | 328 KB |
#include <bits/stdc++.h> #define HID ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define int long long #define all(v) v.begin(),v.end() const int N = 2010 , INF = 1e15; using namespace std; int n , x , all; int ans[160] = {0}; int check(vector<int>v) { cout<<v.size()<<" "; for(int i = 0 ; i < v.size() ; i++) cout<<v[i]<<" "; cout<<endl; cin >> x; return x; } int32_t main() { //HID cin >> n; vector<int>in; ans[1]=1; in.push_back(1); for(int i = 2 ; i <= n ; i++) { in.push_back(i); if(check(in) == in.size()) ans[i] = in.size(); else { in.pop_back(); int l = 0 , r = in.size()-1 , cur=0; while(l<=r) { int mid = (l+r)/2; vector<int>out; for(int j = 0 ; j <= mid ; j++) out.push_back(in[j]); out.push_back(i); if(check(out) == out.size()-1) r = mid-1 , cur = mid; else l = mid+1; } //cout<<i <<"!"<< in[cur]<<endl; if(cur!=-1) ans[i] = ans[in[cur]]; } } cout<<"0 "; for(int i = 1 ; i <= n ; i++) cout<<ans[i]<<" "; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 200 KB | Output is correct |
2 | Correct | 7 ms | 200 KB | Output is correct |
3 | Correct | 6 ms | 320 KB | Output is correct |
4 | Correct | 3 ms | 328 KB | Output is correct |
5 | Correct | 6 ms | 200 KB | Output is correct |
6 | Correct | 3 ms | 200 KB | Output is correct |
7 | Correct | 6 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 200 KB | Output is correct |
2 | Correct | 9 ms | 200 KB | Output is correct |
3 | Correct | 5 ms | 200 KB | Output is correct |
4 | Correct | 4 ms | 328 KB | Output is correct |
5 | Correct | 6 ms | 200 KB | Output is correct |
6 | Correct | 6 ms | 200 KB | Output is correct |
7 | Correct | 6 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 200 KB | Output is correct |
2 | Correct | 6 ms | 200 KB | Output is correct |
3 | Correct | 10 ms | 200 KB | Output is correct |
4 | Correct | 3 ms | 328 KB | Output is correct |
5 | Correct | 7 ms | 200 KB | Output is correct |
6 | Correct | 6 ms | 300 KB | Output is correct |
7 | Correct | 8 ms | 300 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 200 KB | Output is correct |
2 | Correct | 6 ms | 200 KB | Output is correct |
3 | Correct | 5 ms | 328 KB | Output is correct |
4 | Correct | 3 ms | 328 KB | Output is correct |
5 | Correct | 8 ms | 200 KB | Output is correct |
6 | Correct | 7 ms | 304 KB | Output is correct |
7 | Correct | 8 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 200 KB | Output is correct |
2 | Correct | 9 ms | 320 KB | Output is correct |
3 | Correct | 7 ms | 200 KB | Output is correct |
4 | Correct | 6 ms | 200 KB | Output is correct |
5 | Correct | 7 ms | 200 KB | Output is correct |
6 | Correct | 7 ms | 312 KB | Output is correct |
7 | Correct | 5 ms | 324 KB | Output is correct |