Submission #749978

# Submission time Handle Problem Language Result Execution time Memory
749978 2023-05-29T02:43:23 Z Thanhs Carnival (CEOI14_carnival) C++14
0 / 100
20 ms 208 KB
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef stack<ll> sll;
typedef queue<ll> qll;
typedef deque<ll> dll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
 
#define endl '\n'
#define pb push_back
#define FOR(i,a,b) for(ll i = a; i <= b; i++)
#define BACK(i,a,b) for(ll i = a; i >= b; i--)
#define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define bp __builtin_popcountll
#define gcd __gcd
#define bit(i,n) ((n>>i)&1)
#define setmin(x,y) x=min((x),(y))
#define setmax(x,y) x=max((x),(y))
#define fl cout.flush();
 
const int MAXN = 150+5;
const ll SQRT = sqrt(2*MAXN);
// const ll SQRT = 4;
const long long inf = 1e18;
const long long MOD = (ll)(1e9+7);

int p,n,ans[MAXN],t,k;
bool check[MAXN];

int main()
{
	// fastIO
	cin>>n;
	cout<<n<<' '; FOR(i,1,n) cout<<i<<' '; cout<<endl; fl;
	cin>>p;
	k=p;
	BACK(i,n-1,1)
	{
		cout<<i<<' '; FOR(j,1,i) cout<<j<<' '; cout<<endl; fl;
		cin>>t;
		if(t<p) ans[i+1]=k--;
		if(k==1) {ans[i]=1; break;}
	}
	check[0]=1;
	FOR(i,1,n) if(!check[ans[i]])
	{
		FOR(j,1,n) if(!ans[j])
		{
			cout<<2<<' '<<i<<' '<<j<<endl; fl;
			cin>>t;
			if(t==1) ans[j]=ans[i];
		}
		check[ans[i]]=true;
	}
	cout<<"0 "; FOR(i,1,n) cout<<ans[i]<<' ';
}
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 208 KB Integer 0 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 208 KB Integer 0 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 208 KB Output is correct
2 Incorrect 7 ms 208 KB Integer 0 violates the range [1, 8]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 7 ms 208 KB Output is correct
2 Incorrect 8 ms 208 KB Integer 0 violates the range [1, 6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 208 KB Output is correct
2 Incorrect 20 ms 208 KB Integer 0 violates the range [1, 17]
3 Halted 0 ms 0 KB -