搜索时,剪枝条件等于答案时就可以退出了,不然会超时。

if (cnt >= ans)	return ;

1 comments

  • @ 2025-2-19 13:21:42

    搞错了,其实是排序时没倒序。正序排序才要加等于

    • 1

    Information

    ID
    344
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    # Submissions
    96
    Accepted
    12
    Uploaded By