# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
674269 | groshi | Carnival (CEOI14_carnival) | C++17 | 12 ms | 208 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
using namespace std;
int jaki[200];
int ost=2;
int bylo[200];
int rozne(int x,int y)
{
for(int i=0;i<=150;i++)
bylo[i]=0;
int wynik=0;
for(int i=x;i<=y;i++)
{
if(bylo[jaki[i]])
continue;
wynik++;
bylo[jaki[i]]=1;
}
return wynik;
}
int32_t main()
{
//ios_base::sync_with_stdio(0);
//cin.tie(0);
///cout.tie(0);
int n,odp;
cin>>n;
jaki[1]=1;
for(int i=2;i<=n;i++)
{
int pocz=1,kon=i,sre,ostd;
cout<<i<<" ";
for(int j=1;j<=i;j++)
cout<<j<<" ";
cout<<"\n";
cin>>odp;
if(odp==ost)
{
jaki[i]=ost;
ost++;
continue;
}
while(pocz<kon)
{
sre=(pocz+kon)/2;
cout<<sre-pocz+2<<" ";
for(int j=pocz;j<=sre;j++)
cout<<j<<" ";
cout<<i<<"\n";
cin>>odp;
if(odp==rozne(pocz,sre))
kon=sre;
else pocz=sre+1;
}
jaki[i]=jaki[pocz];
}
cout<<"0 ";
for(int i=1;i<=n;i++)
cout<<jaki[i]<<" ";
cout<<"\n";
return 0;
}
Compilation message (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... |