QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#877064 | #9623. 合成大西瓜 | yeweiliang | WA | 0ms | 3840kb | C++14 | 429b | 2025-01-31 19:18:30 | 2025-01-31 19:18:35 |
Judging History
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 '