QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#747898#9623. 合成大西瓜Lazy_boy#WA 0ms3548kbC++20987b2024-11-14 18:40:072024-11-14 18:40:07

Judging History

你现在查看的是最新测评结果

  • [2024-11-14 18:40:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3548kb
  • [2024-11-14 18:40:07]
  • 提交

answer

#include<bits/stdc++.h>

#define int long long
#define endl '\n'
#define pii std::pair<int ,int>
#define fix(x) std::fixed << std::setprecision(x)
const int inf = 1e17 + 50, MAX_N = 1e5 + 50, mod = 998244353;

void solve() {
	int n, m;
	std::cin >> n >> m;
	std::vector<int> a(n), e(n);
	for(int i = 0; i < n; i++) {
		std::cin >> a[i];
	}

	while (m--) {
		int u, v;
		std::cin >> u >> v;
		u--, v--;
		e[u]++, e[v]++;
	}

	int res = 0;
	for(int i = 0; i < n; i++) {
		if (e[i] > 1) res = std::max(a[i], res);
	}

	std::sort(a.begin(), a.end());
	std::cout << std::max(a[n - 1], res) << endl;
}

signed main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr), std::cout.tie(nullptr);
	int Lazy_boy_ = 1;
//	std::cin >> Lazy_boy_;
	while (Lazy_boy_--) solve();
	return 0;
}
/*
7
5 3 0 0 0 0 0 0 0
4 1 1 1 0 0 0 0 0
1 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 2
99 88 77 66 55 44 33 22 11
100 90 80 70 60 50 40 30 20
 */

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3548kb

input:

7 9
1 4 1 3 3 6 7
5 4
3 6
3 4
2 3
5 2
2 6
6 7
5 1
4 6

output:

7

result:

wrong answer 1st lines differ - expected: '6', found: '7'