QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#738411 | #9623. 合成大西瓜 | chenjiaqiy | WA | 0ms | 3640kb | C++20 | 1.1kb | 2024-11-12 19:00:10 | 2024-11-12 19:00:13 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define ll long long
#define double long double
#define endl '\n'
#define all(a) a.begin(), a.end()
#define pb push_back
#define x first
#define y second
#define debug(_x) cout << #_x << '=' << _x << endl
typedef pair<int, int> PII;
using i64 = long long;
const int mod = 1e9 + 7;
const int N = 2e5 + 10;
int v[N], d[N];
void solve()
{
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++)
{
cin >> v[i];
}
while (m--)
{
int u, v;
cin >> u >> v;
d[u]++;
d[v]++;
}
int ans = 0;
if (n == 1)
{
cout << v[1] << endl;
return;
}
for (int i = 1; i <= n; i++)
{
if (d[i] != 1)
{
ans = max(ans, v[i]);
}
}
sort(v + 1, v + 1 + n, greater());
ans = max(ans, v[1]);
cout << ans << endl;
}
int main()
{
/*ios::sync_with_stdio(false);
cin.tie(nullptr);*/
int _ = 1;
// cin >> _;
while (_--)
solve();
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3640kb
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'