About the limits of the sorting problems.

Revision en2, by ZengDingjun_EggArmy, 2024-10-23 09:20:26

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.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ZengDingjun_EggArmy 2024-10-23 09:20:26 0 (published)
en1 English ZengDingjun_EggArmy 2024-10-23 09:19:43 821 Initial revision (saved to drafts)