This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
///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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |