QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#739927 | #9623. 合成大西瓜 | kinoko777# | WA | 0ms | 3860kb | C++23 | 2.0kb | 2024-11-12 23:57:30 | 2024-11-12 23:57:33 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
typedef unsigned long long ull;
typedef array<int, 3> ar3;
typedef array<int, 4> ar4;
typedef long double ld;
typedef pair<int, int> p11;
typedef pair<string, int> ps1;
typedef pair<ll, ll> p1111;
#define vv vector
#define pb emplace_back
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fi first
#define se second
#define endl '\n'
#define Endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define per(a, b, c) for(int a = b; a <= c; a ++)
#define iper(a, b, c) for(int a = b; a < c; a ++)
#define rep(a, b, c) for(int a = b; a >= c; a --)
#define irep(a, b, c) for(int a = b; a > c; a --)
#define aper(A) for(auto i : A) cout << i << ' ';cout << '\n'
#define lowbit(x) ((x) & (-x))
#define debug(x) cout << (x) << endl
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define PAI acos(-1)
using ll = long long;
mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());
template<class T> void umin(T &x,T y){if(x>y)x=y;}
template<class T> void umax(T &x,T y){if(x<y)x=y;}
const int mod = 998244353, inf = 1e18;
const double eps = 1e-9;
void add(int &x, int y){x = (x + y) % mod;}
void pre_work(){}
void solve()
{
int n, m;
cin >> n >> m;
vv<int> a(n + 1);
per(i, 1, n) cin >> a[i];
vv<int> din(n + 1);
per(i, 1, m)
{
int u, v;
cin >> u >> v;
din[u] ++, din[v] ++;
}
int ma = 0;
per(i, 1, n)
if(din[i] > 1)
ma = max(ma, a[i]);
cout << ma << endl;
}
signed main()
{
#ifdef LOCAL
freopen("oo.in", "r", stdin);
freopen("oo.out", "w", stdout);
#endif
IOS;
int tt = 1;
// cin >> tt;
pre_work();
while(tt --)
{
solve();
}
return 0;
}
/*
7 7
1 1 2 3 1 2 1
1 2
2 3
1 3
2 4
2 5
5 6
5 7
*/
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3620kb
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:
ok single line: '6'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
5 7 1 5 3 1 4 3 5 1 3 5 1 1 4 5 4 2 4 3 2
output:
5
result:
ok single line: '5'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
7 7 2 4 2 3 3 6 7 5 1 2 6 5 3 4 6 1 6 1 2 2 7
output:
6
result:
ok single line: '6'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
3 2 2 2 2 2 3 1 3
output:
2
result:
ok single line: '2'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
5 5 3 1 2 4 5 3 2 2 4 3 5 5 1 2 5
output:
5
result:
ok single line: '5'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
7 9 3 2 3 5 2 6 7 7 4 5 4 5 6 1 7 1 6 2 3 7 6 6 4 4 2
output:
7
result:
ok single line: '7'
Test #7:
score: -100
Wrong Answer
time: 0ms
memory: 3684kb
input:
3 2 1 2 3 3 1 2 1
output:
1
result:
wrong answer 1st lines differ - expected: '2', found: '1'