Submission #749982

#TimeUsernameProblemLanguageResultExecution timeMemory
749982ThanhsCarnival (CEOI14_carnival)C++14
0 / 100
17 ms208 KiB
#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]<<' '; }
#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...