This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std ;
#define int long long
#define X first
#define Y second
#define F first
#define S second
//#define endl "\n"
#define pii pair < int , int >
int ans[155] ;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n ; cin >> n ;
int c = 0 ;
for ( int i = 1 ; i <= n ; i++ )
{
if ( ans[i] != 0 ) continue ;
else { c++ ; ans[i] = c ; }
for ( int j = i+1 ; j <= n ; j++ )
{
if ( ans[j] != 0 ) continue;
cout << 2 << " " << i << " " << j << endl ;
int x ; cin >> x ;
if ( x == 1 ) ans[j] = c ;
}
}
for ( int i = 0 ; i <= n ; i++ ) cout << ans[i] << " " ;
cout << endl ;
}
# | 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... |