Submission #245645

# Submission time Handle Problem Language Result Execution time Memory
245645 2020-07-07T03:11:56 Z NhatMinh0208 Carnival (CEOI14_carnival) C++14
100 / 100
23 ms 512 KB
/*
 A Submission by $%U%$
 at time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
*/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define FILE_IN "text.out"
#define FILE_OUT "result.out"
#define ofile freopen(FILE_IN,"r",stdin);freopen(FILE_OUT,"w",stdout)
#define fio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define nfio cin.tie(0);cout.tie(0)
#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))
#define ord(a,b,c) ((a>=b)and(b>=c))
#define MOD (ll(1000000007))
#define MAX 300001
#define mag 320
#define p1 first
#define p2 second.first
#define p3 second.second
#define fi first
#define se second
#define pow2(x) (ll(1)<<x)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define piii pair<int,pii>
#define For(i,__,___) for(int i=__;i<=___;i++)
#define Rep(i,__,___) for(int i=__;i>=___;i--)
#define ordered_set tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update>
#define bi BigInt
#define vec plv.se
#define pi 3.1415926535897
typedef long long ll;
//------------xúc xích normie tám muoi tám phan tram não----------//
ll n,m,k,b,c[1001],t,t1,i,j,minn,maxx,cur=0,lu,lv,sum=0,mul=1;
vector<ll> pool[1001];
string s;
ll check (ll l, ll r, ll x) 
{
	cout<<r-l+2<<' ';
	for (ll i=l;i<=r;i++) cout<<pool[i][0]<<' ';
	cout<<x<<endl;
	ll res; cin>>res;
	return (res==r-l+1);
}
ll bs (ll l, ll r, ll x)
{
	if (l==r) return l;
	ll mid=(l+r)/2;
	if (check(l,mid,x)) return bs(l,mid,x); else return bs(mid+1,r,x);
}
int main() {
//	ofile;
	fio;
	cin>>n;
	for (i=1;i<=n;i++)
	{
		if (k==0) 
		{
			k++;
			pool[k].push_back(i);
			c[i]=k;
		}
		else
		{
			if (!check(1,k,i)) 
		{
			k++;
			pool[k].push_back(i);
			c[i]=k;
		}
		else
		pool[bs(1,k,i)].push_back(i); 
			c[i]=bs(1,k,i);
		}
	}
	cout<<0<<' ';
	for (i=1;i<=n;i++) cout<<c[i]<<' ';
}

Compilation message

carnival.cpp:11:0: warning: ignoring #pragma comment  [-Wunknown-pragmas]
 #pragma comment(linker, "/stack:200000000")
# Verdict Execution time Memory Grader output
1 Correct 14 ms 384 KB Output is correct
2 Correct 12 ms 448 KB Output is correct
3 Correct 14 ms 384 KB Output is correct
4 Correct 13 ms 512 KB Output is correct
5 Correct 10 ms 384 KB Output is correct
6 Correct 7 ms 384 KB Output is correct
7 Correct 15 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 384 KB Output is correct
2 Correct 20 ms 384 KB Output is correct
3 Correct 16 ms 384 KB Output is correct
4 Correct 18 ms 384 KB Output is correct
5 Correct 14 ms 384 KB Output is correct
6 Correct 13 ms 384 KB Output is correct
7 Correct 14 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 8 ms 412 KB Output is correct
3 Correct 23 ms 384 KB Output is correct
4 Correct 18 ms 384 KB Output is correct
5 Correct 9 ms 448 KB Output is correct
6 Correct 20 ms 384 KB Output is correct
7 Correct 22 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 384 KB Output is correct
2 Correct 15 ms 384 KB Output is correct
3 Correct 19 ms 512 KB Output is correct
4 Correct 13 ms 384 KB Output is correct
5 Correct 16 ms 384 KB Output is correct
6 Correct 16 ms 384 KB Output is correct
7 Correct 17 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 384 KB Output is correct
2 Correct 17 ms 384 KB Output is correct
3 Correct 16 ms 408 KB Output is correct
4 Correct 19 ms 384 KB Output is correct
5 Correct 19 ms 384 KB Output is correct
6 Correct 15 ms 384 KB Output is correct
7 Correct 15 ms 384 KB Output is correct