QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#764979 | #9623. 合成大西瓜 | Heenpei# | WA | 1ms | 5704kb | C++23 | 1.5kb | 2024-11-20 11:28:06 | 2024-11-20 11:28:11 |
Judging History
answer
#include<bits/stdc++.h>
#define endl '\n'
#define ll long long
#define Int __int128
#define pb push_back
#define eb emplace_back
#define MAX_LOG 21
#define ff first
#define ss second
#define M (int)1e4+10
#define ull unsigned long long
#define MAX_LOG 21
//#define double long double
using namespace std;
const double PI=3.1415926535897932385;
const int IIMIN=-2147483648;
//const ll p=998244353;
const ll mod=1e9+7;
const int INF=0x3f3f3f3f;
typedef pair<ll,ll> PLL;
typedef pair<double,double>PFF;
ll gcd(ll a,ll b)
{
if(b) while((a%=b)&&(b%=a));
return a+b;
}//最大公约数函数
ll spid(ll a,ll b,ll p)
{
ll ans=1;
while(b)
{
if(b&1)ans=ans*a%p;
b>>=1;
a=a*a%p;
}
return ans;
}//快速幂函数
///小香猪的代码块·香香猪猪惹人怜~
///秋雨想睡觉
const ll N =4e5+10;
ll a[N];
ll du[N];
void solve()
{
ll n,m;cin>>n>>m;
for(int i=1;i<=n;i++)cin>>a[i];
while(m--)
{
ll u,v;cin>>u>>v;
du[u]++;du[v]++;
}
ll max_=0,min_=1e18;
for(int i=1;i<=n;i++)
{
if(du[i]>=2)max_=max(a[i],max_);
else min_=min(a[i],min_);
}
cout<<max(max_,min_);
}
///秋雨睡觉了
//7 7
//1 1 2 3 1 2 1
//1 2
//2 3
//1 3
//2 4
//2 5
//5 6
//5 7
signed main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t=1;
// cin>>t;
while(t--)
{
solve();
}
}
///记忆是梦的开场白
/*
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 5704kb
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: -100
Wrong Answer
time: 1ms
memory: 5688kb
input:
5 7 1 5 3 1 4 3 5 1 3 5 1 1 4 5 4 2 4 3 2
output:
1000000000000000000
result:
wrong answer 1st lines differ - expected: '5', found: '1000000000000000000'