#include <bits/stdc++.h>
//#define endl '\n'
#define mk make_pair
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef long long ll;
using namespace std;
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
map<int, int> mp;
int main()
{
FAST;
int n;
cin>>n;
int cnt = 1;
for(int i=1; i<n; i++)
{
for(int j=i+1; j<=n; j++)
{
cout<<2<<' '<<i<<' '<<j<<endl;
int x; cin>>x;
if(x == 1)
{
if(mp[i] == 0){
mp[i] = cnt;
mp[j] = cnt;
cnt++;
}
else{
mp[j] = mp[i];
}
}
else{
if(mp[i] == 0){
mp[i] = cnt;
cnt++;
}
if(mp[j] == 0){
mp[j] = cnt;
cnt++;
}
}
}
}
cout<<0<<' ';
for(int i=1; i<=n; i++)
{
cout<<mp[i]<<' ';
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
65 ms |
208 KB |
Integer 17 violates the range [1, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
78 ms |
208 KB |
Integer 6 violates the range [1, 5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
74 ms |
208 KB |
Partially correct |
2 |
Incorrect |
77 ms |
208 KB |
Integer 10 violates the range [1, 8] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
89 ms |
208 KB |
Partially correct |
2 |
Incorrect |
104 ms |
316 KB |
Integer 8 violates the range [1, 6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
96 ms |
208 KB |
Partially correct |
2 |
Incorrect |
87 ms |
208 KB |
Integer 20 violates the range [1, 17] |
3 |
Halted |
0 ms |
0 KB |
- |