/*
Editor: Abdelrahman Hossam
Nickname: Blobo2_Blobo2
IOI next year isA :)
*/
/*#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define endl "\n"
#define all(v) v.begin(),v.end()
#define gen(arr,n,nxt) generate(arr,arr+n,nxt)
#define Blobo2_el_7akim_elly_3ayz_yro7_IOI_w_3ayz_yakol_jilaty ios_base::sync_with_stdio(false);cin.tie(0);
#define EPS 0.00000001
const int mo=1e9+7,INF=1e18;
int nxt(){int x;cin>>x;return x;}
int ask(int x,int y){
cout<<2<<' '<<x<<' '<<y<<endl;
return nxt();
}
signed main(){
//Blobo2_el_7akim_elly_3ayz_yro7_IOI_w_3ayz_yakol_jilaty
int n=nxt();
map<int,int>mp;
vector<int>v;
int x = ask(1,2);
if(x == 1){
v.push_back(1);
mp[1]=1;
mp[2]=1;
}
else
v.push_back(1),v.push_back(2),mp[1]=1,mp[2]=2;
int idx=3;
for(int i=3;i<=n;i++){
bool ok=0;
for(auto x:v){
int y = ask(x,i);
if(y == 1){
ok=1;
mp[i]=mp[x];
break;
}
}
if(!ok){
v.push_back(i);
mp[i]=idx;
idx++;
}
}
cout<<0<<' ';
for(int i=1;i<=n;i++)cout<<mp[i]<<' ';
cout<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
328 KB |
Output is correct |
2 |
Correct |
24 ms |
200 KB |
Output is correct |
3 |
Partially correct |
70 ms |
292 KB |
Partially correct |
4 |
Partially correct |
83 ms |
284 KB |
Partially correct |
5 |
Incorrect |
2 ms |
200 KB |
Integer 4 violates the range [1, 3] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
200 KB |
Output is correct |
2 |
Correct |
17 ms |
288 KB |
Output is correct |
3 |
Partially correct |
50 ms |
200 KB |
Partially correct |
4 |
Partially correct |
95 ms |
288 KB |
Partially correct |
5 |
Correct |
3 ms |
200 KB |
Output is correct |
6 |
Incorrect |
3 ms |
200 KB |
Integer 16 violates the range [1, 15] |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
200 KB |
Output is correct |
2 |
Correct |
5 ms |
200 KB |
Output is correct |
3 |
Partially correct |
36 ms |
284 KB |
Partially correct |
4 |
Partially correct |
115 ms |
200 KB |
Partially correct |
5 |
Correct |
5 ms |
200 KB |
Output is correct |
6 |
Incorrect |
11 ms |
200 KB |
Integer 40 violates the range [1, 39] |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
200 KB |
Output is correct |
2 |
Correct |
6 ms |
200 KB |
Output is correct |
3 |
Partially correct |
80 ms |
292 KB |
Partially correct |
4 |
Partially correct |
124 ms |
280 KB |
Partially correct |
5 |
Correct |
11 ms |
300 KB |
Output is correct |
6 |
Correct |
32 ms |
276 KB |
Output is correct |
7 |
Correct |
17 ms |
320 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
392 KB |
Output is correct |
2 |
Correct |
16 ms |
292 KB |
Output is correct |
3 |
Partially correct |
72 ms |
272 KB |
Partially correct |
4 |
Partially correct |
55 ms |
400 KB |
Partially correct |
5 |
Correct |
24 ms |
200 KB |
Output is correct |
6 |
Partially correct |
70 ms |
280 KB |
Partially correct |
7 |
Partially correct |
119 ms |
200 KB |
Partially correct |