Submission #1348691

#TimeUsernameProblemLanguageResultExecution timeMemory
1348691weedywelon사육제 (CEOI14_carnival)C++20
20 / 100
19 ms416 KiB
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <limits.h>
#include <set>
#include <string>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <map>
#include <chrono>
#include <random>
#include <bitset>
#include <tuple>
#include <cassert>
#define SZ(x) (LL)(x.size())
#define FR(i,a,b) for(LL i=(a);i<(b);++i)
#define FOR(i,n) FR(i,0,n)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define A first
#define B second
#define mp(a,b) make_pair(a,b)
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef unsigned __int128 U128;
typedef __int128 I128;
typedef std::pair<int,int> PII;
typedef std::pair<LL,LL> PLL;
typedef std::pair<LD,LD> PLD;
using namespace std;

//independent set -> size c
//n^2 -> test if everything the same lol
//n -> find everything thats the same as 1

const LL MAXN=155;
vector<LL> v[MAXN];
bool vis[MAXN];
LL ans[MAXN];

signed main(){
	LL n; cin>>n;
	
	LL id=0;
	FR(i,1,n+1){
		if (vis[i]) continue;
		id++;
		v[id].push_back(i);
		vis[i]=true;
		FR(j,i+1,n+1){
			cout<<2<<" "<<i<<" "<<j<<endl;
			LL a; cin>>a;
			if (a==1){
				vis[j]=true;
				v[id].push_back(j);
			}
		}
	}
	
	FR(i,1,id+1){
		for (LL x:v[i]) ans[x]=i;
	}
	
	cout<<0<<" ";
	FR(i,1,n+1) cout<<ans[i]<<" ";
	cout<<endl;
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...