Submission #476288

#TimeUsernameProblemLanguageResultExecution timeMemory
476288ShahdMohamedCarnival (CEOI14_carnival)C++17
20 / 100
92 ms200 KiB
///LW M4 ACC HAZ3L GAMED ///YARAB WALA...I MEAN YARAB ACC #include<bits/stdc++.h> #define ll long long //#define endl "\n" const ll mod = (ll) 1e9 + 7; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll n,cnt,took=0,p=1; cin>>n; vector<ll>ans(n); cout<<n<<" "; for (ll i=1; i<=n; i++) cout<<i<<" "; cout<<endl; cin>>cnt; for (ll i=0; i<n; i++){ if (ans[i]==0){ ans[i]=p; took++; for (ll j=i+1; j<n; j++){ if (ans[j]==0){ cout<<"2 "<<i+1<<" "<<j+1<<endl; ll x; cin>>x; if (x==1){ ans[j]=p; took++; } } } p++; cnt--; } if (n-took==cnt){ for (ll j=0; j<n; j++){ if (ans[j]==0){ ans[j]=p; p++; } } break; } } cout<<"0 "; for (auto i:ans) cout<<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...