Hello CodeForces community!
I noticed that some greedy problems are used in passed Div.2 as problem A/B have very large limits like $$$n \ge 10^5$$$, is not friendly for coders who don't know sorting skills.
Why? I think we should let all sorting algorithm pass these problems, including the following code:
vector<int> Sort(vector<int> x){
vector<int> rnk(x.size());
iota(rnk.begin(),rnk.end(),0);
do{
if(is_sorted(rnk.begin(),rnk.end(),[&](int a,int b){return x[a]<x[b];})) break;
}while(next_permutation(rnk.begin(),rnk.end()));
vector<int> res;
for(auto id:rnk) res.push_back(x[id]);
return res;
}
So I advise that we should let these problems' limits less than $$$8$$$.
Thanks, please upvote this.
Z.
You should change the function's name to "joker_sort".
Agree.
ZengDingjun_EggArmy is just a grandstanding clown, so this name is just right with its $$$O(n!)$$$ complexity.
Wow, the stable version of monkey sort (random shuffle, check if it's sorted, and repeat)
Do you play genshin?