# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
575007 |
2022-06-09T14:08:44 Z |
Dodo |
Carnival (CEOI14_carnival) |
C++14 |
|
18 ms |
336 KB |
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
ll inf =1e12;
const ll mx=155;
ll arr[mx];
vector<ll>v[155];
ll vis[mx+1];
ll c=0;
ll n;
ll k;
void dfs(ll x)
{
vis[x]=c;
for(auto u:v[x])
if(!vis[u])dfs(u);
}
ll call (ll l,ll r)
{
k=0;
for(int i=l;i<=r;i++)if(arr[i]==0)k++;
if(k==1)return 1;
if(l==r)return k;
cout<<k<<' ';
for(int i=l;i<=r;i++)
if(arr[i]==0)
cout<<i<<' ';
cout<<endl;
ll x;
cin>>x;
return x;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n;
ll l=1,r=2;
while(r<=n)
{
ll ans=call(l,r);
if(ans!=k)
{
ll le=l+1,ri=r;
while(le<ri)
{
ll ans=call(le,ri);
if(ans==k)break;
le++;
}
v[le-1].push_back(r);
arr[le-1]=1;
}
r++;
while(arr[l]==1)l++;
}
//--------------
for(int i=1;i<=n;i++)
{
if(vis[i]==0)
{
c++;
dfs(i);
}
}
for(int i=1;i<=n;i++)cout<<vis[i]<<' ';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
336 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
256 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
324 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
208 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |