#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++)
{
if(mp[i] == 0)
{
mp[i] = cnt;
cnt++;
for(int j=i+1; j<=n; j++)
{
cout<<2<<' '<<i<<' '<<j<<endl;
int x;
cin>>x;
if(x == 1)
mp[j] = mp[i];
}
}
}
cout<<0<<' ';
for(int i=1; i<=n; i++)
{
cout<<mp[i]<<' ';
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
320 KB |
Output is correct |
2 |
Partially correct |
24 ms |
300 KB |
Partially correct |
3 |
Partially correct |
26 ms |
312 KB |
Partially correct |
4 |
Partially correct |
75 ms |
300 KB |
Partially correct |
5 |
Correct |
3 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
312 KB |
Output is correct |
7 |
Correct |
25 ms |
300 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
208 KB |
Output is correct |
2 |
Correct |
33 ms |
292 KB |
Output is correct |
3 |
Partially correct |
29 ms |
296 KB |
Partially correct |
4 |
Partially correct |
45 ms |
300 KB |
Partially correct |
5 |
Correct |
11 ms |
208 KB |
Output is correct |
6 |
Correct |
9 ms |
208 KB |
Output is correct |
7 |
Correct |
16 ms |
320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
312 KB |
Output is correct |
2 |
Correct |
4 ms |
312 KB |
Output is correct |
3 |
Partially correct |
60 ms |
300 KB |
Partially correct |
4 |
Partially correct |
94 ms |
304 KB |
Partially correct |
5 |
Correct |
12 ms |
208 KB |
Output is correct |
6 |
Correct |
26 ms |
208 KB |
Output is correct |
7 |
Partially correct |
40 ms |
300 KB |
Partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
208 KB |
Output is correct |
2 |
Correct |
9 ms |
208 KB |
Output is correct |
3 |
Partially correct |
67 ms |
304 KB |
Partially correct |
4 |
Partially correct |
60 ms |
308 KB |
Partially correct |
5 |
Partially correct |
28 ms |
300 KB |
Partially correct |
6 |
Partially correct |
20 ms |
312 KB |
Partially correct |
7 |
Partially correct |
29 ms |
300 KB |
Partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
312 KB |
Output is correct |
2 |
Correct |
16 ms |
320 KB |
Output is correct |
3 |
Partially correct |
71 ms |
296 KB |
Partially correct |
4 |
Partially correct |
91 ms |
300 KB |
Partially correct |
5 |
Partially correct |
49 ms |
320 KB |
Partially correct |
6 |
Partially correct |
59 ms |
296 KB |
Partially correct |
7 |
Partially correct |
95 ms |
296 KB |
Partially correct |