QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#739915#9623. 合成大西瓜suyueovoCompile Error//C++98484b2024-11-12 23:53:062024-11-12 23:53:15

Judging History

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

  • [2024-11-12 23:53:15]
  • 评测
  • [2024-11-12 23:53:06]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,m;
int u,v;
signed main()
{
	cin>>n>>m;
	vector<pair<int,int>> a(n+5);
	for(int i=1;i<=n;i++)
	{
		cin>>a[i].first;
	}
	for(int i=1;i<=m;i++)
	{
		cin>>u>>v;
		a[u].second++;
		a[v].second++;
	}
	sort(a.begin()+1,a.end());
	reverse(a.begin()+1,a.end());
	for(int i=1;i<=n;i++)
	{
		if(a[i].second>=2)
		{ 
			cout<<a[i].first;
			return 0;
		}
	}
	cout<<a[0].first;
	return 0;
 } 

詳細信息

answer.code: In function ‘int main()’:
answer.code:9:28: error: ‘>>’ should be ‘> >’ within a nested template argument list
    9 |         vector<pair<int,int>> a(n+5);
      |                            ^~
      |                            > >