神奇的报错
查看原帖
神奇的报错
542710
小小苏McQueen楼主2021/7/28 19:57

No valid executable file was produced by the compiler /usr/bin/ld: ./cc4lDys5.o: in function __static_initialization_and_destruction_0(int, int)': src:(.text+0x145): relocation truncated to fit: R_X86_64_PC32 against .bss' /usr/bin/ld: src:(.text+0x158): relocation truncated to fit: R_X86_64_PC32 against `.bss' collect2: 错误:ld 返回 1

我的代码:

#include <bits/stdc++.h>
using namespace std;
long long show_first[1000000001];

void search_number(){
    int n, m;
	memset(show_first, -1, sizeof(show_first));
	cin>>n>>m;
	for(long long i=1; i<n+1; i++){
		long long num;
		cin>>num;
		if(show_first[num]==-1)
			show_first[num]=i;}
	for(int i=0; i<m; i++){
		long long r;
		cin>>r;
		long long answer=show_first[r];
		cout<<answer<<" ";}
	return;
}

int main(){
	search_number();
	return 0;
}
2021/7/28 19:57
加载中...