#define RASENGAN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); ...
You are given an array a1,a2,…,an of pairwise distinct integers from 0 to n. Consider the following operation: consecutively for each i from 1 to n in this order, replace a[i] with MEX(a1,a2,…,an).