QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#742149#9623. 合成大西瓜123BVNWA 0ms5576kbC++23726b2024-11-13 15:59:112024-11-13 15:59:14

Judging History

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

  • [2024-11-13 15:59:14]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:5576kb
  • [2024-11-13 15:59:11]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long 
using namespace std;
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int a[N],zhi[N];
void solve() {
	int n, m, mx = 0, mx1 = 0, mx2 = 0;
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		if (a[i] == mx1) {
			mx2 = max(a[i], mx2);
		}
		else {
			mx1 = max(a[i], mx1);
			mx2 = mx1;
		}
	}
	while (m--) {
		int u, v;
		cin >> u>> v;
		zhi[u]++;
		zhi[v]++;
	}
	int ans=mx2;
	for (int i = 1; i <= n; i++) {
		if (a[i] == mx1) {
			if (zhi[i] != 1)ans = mx1;
		}
	}
	cout << ans <<endl;
}
signed main() {
	int _ = 1;
//	cin >> _;
	while (_--) {
		solve();
	}
}

/*
7 7
1 1 2 3 1 2 1
1 2
2 3
1 3
2 4
2 5
5 6
5 7
*/

詳細信息

Test #1:

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

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'