#include <iostream>
#include <set>
#include <vector>
using namespace std;
int main()
{
int n;
cin>>n;
int c=1;
int val[n+3];
set<int> left;
for(int i=1;i<=n;i++)
{
val[i]=-1;
left.insert(i);
}
for(int i=1;i<=n;i++)
{
if(val[i]!=-1)
continue;
val[i]=c;
left.erase(i);
vector<int> rem;
for(auto j:left)
{
cout<<2<<' '<<i<<' '<<j<<endl;
int dif;
cin>>dif;
if(dif==1)
{
val[j]=val[i];
rem.push_back(j);
}
}
for(auto j:rem)
{
left.erase(j);
}
c++;
}
cout<<0;
for(int i=1;i<=n;i++)
{
cout<<' '<<val[i];
}
cout<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
208 KB |
Output is correct |
2 |
Correct |
14 ms |
208 KB |
Output is correct |
3 |
Partially correct |
39 ms |
208 KB |
Partially correct |
4 |
Partially correct |
39 ms |
208 KB |
Partially correct |
5 |
Correct |
2 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
14 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
208 KB |
Output is correct |
2 |
Correct |
12 ms |
208 KB |
Output is correct |
3 |
Partially correct |
30 ms |
208 KB |
Partially correct |
4 |
Partially correct |
72 ms |
208 KB |
Partially correct |
5 |
Correct |
3 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
6 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
5 ms |
208 KB |
Output is correct |
3 |
Partially correct |
22 ms |
208 KB |
Partially correct |
4 |
Partially correct |
67 ms |
208 KB |
Partially correct |
5 |
Correct |
3 ms |
208 KB |
Output is correct |
6 |
Correct |
8 ms |
208 KB |
Output is correct |
7 |
Correct |
11 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
208 KB |
Output is correct |
2 |
Correct |
5 ms |
208 KB |
Output is correct |
3 |
Partially correct |
48 ms |
208 KB |
Partially correct |
4 |
Partially correct |
35 ms |
208 KB |
Partially correct |
5 |
Correct |
9 ms |
208 KB |
Output is correct |
6 |
Correct |
19 ms |
208 KB |
Output is correct |
7 |
Correct |
11 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
208 KB |
Output is correct |
2 |
Correct |
7 ms |
208 KB |
Output is correct |
3 |
Partially correct |
43 ms |
208 KB |
Partially correct |
4 |
Partially correct |
55 ms |
208 KB |
Partially correct |
5 |
Correct |
20 ms |
208 KB |
Output is correct |
6 |
Partially correct |
36 ms |
208 KB |
Partially correct |
7 |
Partially correct |
84 ms |
208 KB |
Partially correct |