Submission #1131568

#TimeUsernameProblemLanguageResultExecution timeMemory
1131568adkjtCarnival (CEOI14_carnival)C++20
20 / 100
26 ms420 KiB
#include<bits/stdc++.h> using namespace std; #define pii pair<int,int> #define f first #define s second //int p[222]; vector<pii> v;//i,c map<int,int> mp; int main() { int n;cin>>n; mp[1]=1; int cur=1; v.push_back({1,1}); for(int i=2;i<=n;i++) { int ch=0; for(auto x:v){ cout<<2<<' '<<i<<' '<<x.f<<'\n'; int ans;cin>>ans; if(ans==1) { ch=1; mp[i]=x.s; break; } } if(!ch) { cur++; v.push_back({i,cur}); mp[i]=cur; } } cout<<0; for(int i=1;i<=n;i++) { cout<<' '<<mp[i]; } cout<<'\n'; }
#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...