# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
113666 | Adhyyan1252 | 사육제 (CEOI14_carnival) | C++11 | 6 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int query(const vector<int>& a){
if(a.size() == 0) return 0;
cout<<a.size()<<endl;
for(int b: a) cout<<b+1<<" ";
cout<<endl;
int ret; cin>>ret;
return ret;
}
int main(){
int n; cin>>n;
vector<int> a(n, -1);
a[0] = 1;
int pntr = 2;
vector<int> diff; diff.push_back(0);
for(int i = 1; i < n; i++){
int low = 0, high = diff.size()-1, mid;
vector<int> c(diff); c.push_back(i);
if(query(c) == c.size()){
//this is a new one
a[i]= pntr; pntr++;
diff.push_back(i);
continue;
}
while(low < high){
mid = (low + high)/2;
vector<int> b(diff.begin() + low, diff.begin() + mid + 1);
b.push_back(i);
int q = query(b);
if(q == b.size()-1){
//means that they share the shit
high = mid;
}else{
low = mid+1;
}
}
mid = (low + high)/2;
a[i] = a[mid];
}
cout<<0<<" ";
for(int i = 0; i < n; i++) cout<<a[i]<<" ";
cout<<endl;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |