提交记录 20705


用户 题目 状态 得分 用时 内存 语言 代码长度
TSKY 1001a. 测测你的排序2 Accepted 100 13.913 ms 48 KB C++14 699 B
提交时间 评测时间
2023-12-03 20:52:06 2023-12-03 20:52:09
#include <algorithm>
template<typename It,typename T>
It find_insert(It first,It last,T &&n)
{
    auto l=first-1,r=last;
    while(l+1<r)
    {
        auto mid = l+(r-l)/2;
        if(n<*mid)
        {
            r=mid;
        }
        else
        {
            l=mid;
        }
    }
    return r;
}
template <typename It>
void insert_sort(It begin, It end)
{
    for (auto it1 = begin+1;it1 < end;it1++)
    {
        auto it2 = it1-1;
        auto cur = std::move(it1[0]);
        while (it2 >= begin&&cur<it2[0])
        {
            it2[1] = std::move(it2[0]);
            it2--;
        }
        it2[1]=std::move(cur);
    }
}
void sort(unsigned *a, int n) {
	insert_sort(a, a + n);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #113.913 ms48 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2025-05-09 11:23:29 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠