编译失败
  • 板块学术版
  • 楼主Stars_never_set
  • 当前回复4
  • 已保存回复4
  • 发布时间2023/11/4 11:11
  • 上次更新2023/11/4 13:29:49
查看原帖
编译失败
929863
Stars_never_set楼主2023/11/4 11:11

求助下面代码为什么会编译失败,以及应该如何改正。

#include<bits/stdc++.h>
using namespace std;
const int N=1e6+6;

inline int read()
{
	int x=0,y=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-') y=-y;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+(c^'0');c=getchar();}
	return x*y;
}
int n;
double ans,a,x;


double dksm(double a,int b)
{
	double res=1.0;
	for(;b;b>>=1,a=a*1.0*a) if(b&1) res=res*1.0*a;
	return res;
}

priority_queue<pair<int,int>,vector<int,int>,greater<pair<int,int> > >que;

signed main()
{
	cin>>n;
	while(n--)
	{
		int b=read(),c=read();
		pair<int,int>d=make_pair(c,b);
		que.push(d);
	}
	while(que.size())
	{
		printf("%d %d\n",que.top().first,que.top().second);
		que.pop();
	}
	return 0;
}
2023/11/4 11:11
加载中...