About the limits of the sorting problems.

Правка en1, от ZengDingjun_EggArmy, 2024-10-23 09:19:43

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.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский ZengDingjun_EggArmy 2024-10-23 09:20:26 0 (published)
en1 Английский ZengDingjun_EggArmy 2024-10-23 09:19:43 821 Initial revision (saved to drafts)