#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
int main(){
int n,m;cin>>n>>m;
vector<int> val(n);
for (int i = 0; i < n; ++i)
{
cin>>val[i];
}
vector<vector<int>> arr(n);
for (int i = 0; i < m; i++){
int u,v;cin>>u>>v;
arr[u-1].push_back(v-1);
arr[v-1].push_back(u-1);
}
cout<<max(*max_element(val.begin(),val.end())*2,n-1)<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
124 ms |
12128 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
124 ms |
12128 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |