提交记录 9962


用户 题目 状态 得分 用时 内存 语言 代码长度
Wallbreaker5th 2001. 元旦激光炮·改 Compile Error 0 0 ns 0 KB C++ 1.13 KB
提交时间 评测时间
2019-07-31 16:55:05 2020-08-01 01:59:08
int query_kth(const int *a, int n_a, const int *b, int n_b, const int *c, int n_c, int k){
	const int *pa=a,*enda=a+n_a,*pb=b,*endb=b+n_b,*pc=c,*endc=c+n_c;
	for(int i=1;i<k;++i){
		if(pa>=enda){
			if(pb>=endb){
				++pc;
				continue;
			}
			if(pc>=endc){
				++pc;
				continue;
			}
			if(*pb<*pc){
				++pb;
				continue;
			}else{
				++pc;
				continue;
			}
		}
		if(pb>=endb){
			if(pc>=endc){
				++pa;
				continue;
			}
			if(*pa<*pc){
				++pa;
				continue;
			}else{
				++pc;
				continue;
			}
		}
		if(pc>=endc){
			if(*pa<*pb){
				++pa;
				continue;
			}else{
				++pb;
				continue;
			}
		}
		if(*pa<=*pb&&*pa<=*pc){
			++pa;
			continue;
		}
		if(*pb<=*pa&&*pb<=*pc){
			++pb;
			continue;
		}
		++pc;
	}
	if(pa>=enda){
		if(pb>=endb){
			return *pc;
		}
		if(pc>=endc){
			return *pc;
		}
		if(*pb<*pc){
			return *pb;
		}else{
			return *pc;
		}
	}
	if(pb>=endb){
		if(pc>=endc){
			return *pa;
		}
		if(*pa<*pc){
			return *pa;
		}else{
			return *pc;
		}
	}
	if(pc>=endc){
		if(*pa<*pb){
			return *pa;
		}else{
			return *pb;
		}
	}
	if(*pa<=*pb&&*pa<=*pc){
		return *pa;
	}
	if(*pb<=*pa&&*pb<=*pc){
		return *pb;
	}
	return *pc;
}

CompilationN/AN/ACompile ErrorScore: N/A


Judge Duck Online | 评测鸭在线
Server Time: 2026-03-30 10:15:56 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠