提交记录 4738


用户 题目 状态 得分 用时 内存 语言 代码长度
SovietPower 2001. 元旦激光炮·改 Compile Error 0 0 ns 0 KB C++ 719 B
提交时间 评测时间
2018-07-31 18:21:01 2020-07-31 23:11:27
//190ms 1704kb
#include <algorithm>

int query_kth(const int *A,int na,const int *B,int nb,const int *C,int n_c, int k)
{
    const int myINF=0x7fffffff;
    int nowa=-1,nowb=-1,nowc=-1,delta,a,b,c,mn;
    while(k>2)
    {
        delta=k/3;
        a=nowa+delta<=na?A[nowa+delta]:myINF,
        b=nowb+delta<=nb?B[nowb+delta]:myINF,
        c=nowc+delta<=nc?C[nowc+delta]:myINF;
        mn=std::min(a,std::min(b,c));
        if(mn==a) nowa+=delta;
        else if(mn==b) nowb+=delta;
        else if(mn==c) nowc+=delta;
        k-=delta;
    }
    int AA[7];
    AA[1]=A[nowa+1], AA[2]=A[nowa+2];
    AA[3]=B[nowb+1], AA[4]=B[nowb+2];
    AA[5]=C[nowc+1], AA[6]=C[nowc+2];
    std::sort(AA+1,AA+7);
    return AA[k];
}

CompilationN/AN/ACompile ErrorScore: N/A


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-13 01:49:11 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠