怎么回事?悬关!
查看原帖
怎么回事?悬关!
1121748
PYM20111102楼主2024/10/7 15:51

50分,WA#3,#4,#6,#7,#10

#include <bits/stdc++.h> 
using namespace std;
const int M = 2e6 + 1e3 + 5;
int n, k;
int a[M];
int main() {
	cin >> n >> k;
	n = (n * (n + 1)) / 2;
	for (int i = 1; i <= n; i ++) cin >> a[i];
	int tot = 0;
	for (int i = 1; i <= n; i ++) {
		tot += i;
		if (tot >= k) break;
	}
	sort(a + 1, a + tot + 1);
	cout << a[1] << endl;
	return 0;
}
2024/10/7 15:51
加载中...