一直显示这个。。。
查看原帖
一直显示这个。。。
542452
int4096楼主2021/10/6 14:29
  
No valid executable file was produced by the compiler
/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: 错误:ld 返回 1

代码:

#include <bits/stdc++.h>
using namespace std;
const int N=1e6+10;
int n,k,a[N][N],ans,x,y;
int vis[N][N];//vis表示格子是否被走过 
int main(){
	memset(vis,0,sizeof(vis));
	cin>>n>>k; 
	for(int i=1;i<=k;i++){
		cin>>x>>y;
		vis[x][y]=1;
		for(int i=1;i<=n;i++){
			if(vis[x][i]!=1){
				vis[x][i]=1;
				ans++;
			}
		}
		for(int i=1;i<=n;i++){
			if(vis[i][y]!=1){
				vis[i][y]=1;
				ans++;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}
2021/10/6 14:29
加载中...