답안 #749983

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
749983 2023-05-29T02:54:42 Z Thanhs 사육제 (CEOI14_carnival) C++14
0 / 100
11 ms 248 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;
	cin>>p;
	k=p;
	BACK(i,n-1,1)
	{
		cout<<i<<' '; FOR(j,1,i) cout<<j<<' '; cout<<endl;
		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;
			cin>>t;
			if(t==1) ans[j]=ans[i];
		}
		check[ans[i]]=true;
	}
	cout<<"0 "; FOR(i,1,n) cout<<ans[i]<<' ';
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 208 KB Integer 0 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 208 KB Integer 0 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 208 KB Output is correct
2 Incorrect 6 ms 248 KB Integer 0 violates the range [1, 6]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 208 KB Output is correct
2 Incorrect 11 ms 208 KB Integer 0 violates the range [1, 17]
3 Halted 0 ms 0 KB -