QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#736964 | #9623. 合成大西瓜 | ehdxbc | WA | 0ms | 3852kb | C++20 | 618b | 2024-11-12 14:04:37 | 2024-11-12 14:04:38 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> PII;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(0);
int n, m;
cin >> n >> m;
vector<PII> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i].first;
a[i].second = i;
}
vector<int> out(n);
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
x--, y--;
out[x]++;
out[y]++;
}
sort(a.begin(), a.end());
if (out[a[0].second] != 1) {
cout << a[0].first << endl;
} else {
cout << a[1].first << endl;
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3852kb
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:
1
result:
wrong answer 1st lines differ - expected: '6', found: '1'