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;
}