QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#877064#9623. 合成大西瓜yeweiliangWA 0ms3840kbC++14429b2025-01-31 19:18:302025-01-31 19:18:35

Judging History

This is the latest submission verdict.

  • [2025-01-31 19:18:35]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3840kb
  • [2025-01-31 19:18:30]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,m,u,v,a[N],b[N],id[N];
bool cmp(int x,int y){
	return a[x]>a[y];
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		id[i]=i;
	}
	for(int i=1;i<=m;i++){
		scanf("%d%d",&u,&v);
		b[u]++;
		b[v]++;
	}
	sort(id+1,id+n+1,cmp);
	if(b[id[1]]==1) printf("%d ",a[id[2]]);
	else printf("%d ",a[id[1]]);
	return 0;
}

详细

Test #1:

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

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:

6 

result:

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