/ Randle /

记录详情

Compile Error

/tmp/cchyINQb.o: In function `_GLOBAL__sub_I_f':
foo.cc:(.text.startup+0x153): relocation truncated to fit: R_X86_64_PC32 against `.bss'
foo.cc:(.text.startup+0x171): relocation truncated to fit: R_X86_64_PC32 against `.bss'
collect2: error: ld returned 1 exit status

代码

#include <bits/stdc++.h>
using namespace std;
struct xxx
{
	int x,y,z;
}f[1000000005];
int n;
int main()
{
//    freopen("card.in","r",stdin);
//    freopen("card.out","w",stdout);
	int x,y;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d %d",&x,&y);
		f[x].x++;
		f[y].x++;
		f[x].y++;
	}
	int m=(n+1)/2,b=0;
	for(int i=1;i<=n;i++)
	{
		if(f[i].x>=m)
		  b=1;
	}
	if(b==0)
	{
	  printf("Impossible");
      return 0;
	}
	int minn=1e9;
	for(int i=1;i<=n;i++)
	{
		if(f[i].x>=m)
		  f[i].z=m-f[i].y;
		else
		  f[i].z=1e9;
		minn=min(minn,f[i].z);
//		cout<<f[i].x<<' '<<f[i].y<<' '<<f[i].z<<endl;
	}
	printf("%d",minn);
	return 0;
}

信息

递交者
类型
递交
题目
纸牌
题目数据
下载
语言
C++
递交时间
2019-12-13 15:20:15
评测时间
2019-12-13 15:20:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes