QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#738398 | #9623. 合成大西瓜 | chenjiaqiy | WA | 0ms | 3612kb | C++20 | 1.1kb | 2024-11-12 18:58:13 | 2024-11-12 18:58:14 |
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[1] != 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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
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'