编译错误求查!!!
查看原帖
编译错误求查!!!
373547
Dzyee楼主2021/7/10 22:59
#include<stdio.h>
#include<queue>
using namespace std;
int n;
long long a[1500000005];
priority_queue<long long ,vector<long long>,greater<long long> > q;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		long long x;
		scanf("%lld",&x);
		if(!a[x]) a[x]=1,q.push(x);
		else a[x]++;
	}
	while(!q.empty())
	{
		printf("%lld %lld\n",q.top(),a[q.top()]);
		q.pop();
	}
	return 0;
} 
2021/7/10 22:59
加载中...