# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
166532 | Lawliet | Carnival (CEOI14_carnival) | C++14 | 11 ms | 380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 150;
int n;
int qtdGroups;
int myGroup[MAXN];
vector< int > costumes;
vector< int > curQuery;
vector< int > group[MAXN];
int query(int t)
{
if( t == 0 ) swap( curQuery , costumes );
printf("%d ",curQuery.size());
for(int i = 0 ; i < curQuery.size() ; i++)
printf("%d ",curQuery[i]);
printf("\n");
fflush( stdout );
int a;
scanf("%d",&a);
if( t == 0 ) swap( curQuery , costumes );
return a;
}
void createGroup(int i)
{
myGroup[ i ] = ++qtdGroups;
group[ qtdGroups ].push_back( i );
}
int bs(int k)
{
int l = 0;
int r = costumes.size() - 1;
while( l < r )
{
int m = ( l + r )/2;
curQuery.clear();
for(int i = l ; i <= m ; i++)
curQuery.push_back( costumes[i] );
int qtd = curQuery.size();
curQuery.push_back( k );
if( query( 1 ) != qtd ) l = m + 1;
else r = m;
}
return l;
}
int main()
{
scanf("%d",&n);
createGroup( 1 );
costumes.push_back( 1 );
for(int i = 2 ; i <= n ; i++)
{
int qtd = costumes.size();
costumes.push_back( i );
if( query( 0 ) != qtd ) createGroup( i );
else
{
costumes.pop_back();
myGroup[ i ] = myGroup[ costumes[ bs(i) ] ];
}
}
printf("0 ");
for(int i = 1 ; i <= n ; i++)
printf("%d ",myGroup[i]);
}
컴파일 시 표준 에러 (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... |