记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Accepted 1ms 216.0 KiB
#2 Accepted 1ms 220.0 KiB
#3 Accepted 589ms 720.0 KiB
#4 Time Exceeded ≥1003ms ≥960.0 KiB
#5 Time Exceeded ≥1001ms ≥1.027 MiB
#6 Time Exceeded ≥1002ms ≥1.027 MiB
#7 Time Exceeded ≥1000ms ≥1.027 MiB
#8 Time Exceeded ≥1001ms ≥1.023 MiB
#9 Time Exceeded ≥1000ms ≥1.027 MiB
#10 Time Exceeded ≥1004ms ≥1012.0 KiB

代码

#include <iostream> 
typedef long long ll;
ll n,k;
ll a[80010][2], b[3], topa, topb;
int main(){
	std::ios::sync_with_stdio(false);
	std::cin >> n >> k;
	for(int i = 1 ; i <= n ; ++i ){
		ll temp; bool flag = false;
		std::cin >> temp;
		for(int j = 1 ; j <= topa && !flag; ++j){
			if(a[j][0] == temp)
				++a[j][1], flag = true;
		}
		if(flag) continue;
		a[++topa][0] = temp;
		++a[topa][1];
	}
	for(int i = 1 ; i <= topa ; ++i){
		if(a[i][1] & 1)
			b[++topb] = a[i][0];
	}
	//assert topb >= 1
	if(topb == 1){
		std::cout << b[topb];
	}else{
		if(b[1] > b[2])
			std::cout << b[2] << ' ' << b[1];
		else
			std::cout << b[1] << ' ' << b[2];
	}
	return 0;
}

信息

递交者
类型
递交
题目
亚由题
语言
C++
递交时间
2020-12-23 09:01:04
评测时间
2020-12-23 09:01:05
评测机
分数
30
总耗时
≥7607ms
峰值内存
≥1.027 MiB