QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#737016#9623. 合成大西瓜CodeChild#WA 0ms3584kbC++201.4kb2024-11-12 14:15:212024-11-12 14:15:22

Judging History

你现在查看的是最新测评结果

  • [2024-11-12 14:15:22]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3584kb
  • [2024-11-12 14:15:21]
  • 提交

answer

#include <iostream>
#include <cstring>
#include <queue>
#include <map>
#include <cstdio>
#include <unordered_map>
#include <deque>
#include <iomanip>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
#include <array>
#include <bitset>
#include <limits.h>
#include <numeric>
#define x first
#define y second

using namespace std;
typedef  long long LL;
typedef long long ll  ; 
typedef pair<int,int> PII;
typedef pair<int,LL> PIL;
typedef pair<int ,PII> PIII ;
typedef pair<int, pair<PII ,int > > PIIII;
typedef pair<LL , LL> PLL ; 
typedef pair<LL ,int > PLI ;
typedef pair<int,char > PIC ; 
typedef unsigned long long ULL ;
 
const int N = 5e5+10,M = 4e5+10  ;
const LL mod = 1e9+7 , INF = 1e18+10;
const int inf =  1e8 ; 
const double eps = 1e-7 ;
const ULL  P=  131 ;
LL n , m  , k   ;



void solve( ) {
	cin >> n >> m ;
	vector<int> a(n) ;
	for(auto &x : a ) cin >> x ;
	while( m -- ) {
		int u , v;  cin >> u >> v ;
	}
	
	if( n == 1 ) {
		cout << a[0] << '\n'; return ;
	}
	sort( a.begin() , a.end()) ; reverse( a.begin() , a.end()) ;
	if( a[0] == a[1] ) cout << a[0] ;
	else cout << a[1] << '\n';
	
	
} 	
 
 
 
int main(){ 	
	ios::sync_with_stdio(false);
	cin.tie( 0 ) ; cout.tie(0) ;
	int T = 1 ;
	// cin >> T ;
	while(T-- ){	
		solve() ;  
   	}        
 	return  0 ;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3548kb

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: 0ms
memory: 3584kb

input:

5 7
1 5 3 1 4
3 5
1 3
5 1
1 4
5 4
2 4
3 2

output:

4

result:

wrong answer 1st lines differ - expected: '5', found: '4'