Submission #444966

#TimeUsernameProblemLanguageResultExecution timeMemory
444966BT21tata사육제 (CEOI14_carnival)C++17
20 / 100
138 ms200 KiB
#include<bits/stdc++.h> // #pragma GCC target ("avx,avx2,fma") // #pragma GCC optimize("Ofast") // #pragma GCC optimize("unroll-loops") typedef long long ll; typedef long double ld; #define SPEED ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0) #define rall(v) (v).rbegin(),(v).rend() #define all(v) (v).begin(),(v).end() #define OK cerr<<"OK"<<endl<<flush #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back #define F first #define S second #define y0 jahdakdh #define y1 jahsadakdakdh #define endl '\n' using namespace std; const ll MOD=1e9+7; // mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count()); int n, a[155], mx=1, p, q; int main() { SPEED; cin>>n; a[1]=1; for(int i=2; i<=n; i++) { p=0; for(int j=1; j<=i-1; j++) { cout<<2<<' '<<j<<' '<<i<<endl<<flush; cin>>q; if(q==1) a[i]=a[j], p=1; } if(!p) a[i]=++mx; } for(int i=0; i<=n; i++) cout<<a[i]<<' '; 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...