Submission #1117556

#TimeUsernameProblemLanguageResultExecution timeMemory
1117556patgraBubble Sort 2 (JOI18_bubblesort2)C++17
Compilation error
0 ms0 KiB
#include "bubblesort2.h"

#include <cstdio>
#include <cstdlib>
#include <vector>

int readInt(){
	int i;
	if(scanf("%d",&i)!=1){
		fprintf(stderr,"Error while reading input\n");
		exit(1);
	}
	return i;
}

int main(){
	int N,Q;
	N=readInt();
	Q=readInt();
	
	std::vector<int> A(N);
	for(int i=0;i<N;i++)
		A[i]=readInt();
	
	std::vector<int> X(Q),V(Q);
	for(int j=0;j<Q;j++){
		X[j]=readInt();
		V[j]=readInt();
	}
	
	std::vector<int> res=countScans(A,X,V);
	
	for(int j=0;j<int(res.size());j++)
		printf("%d\n",res[j]);
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccYZozNH.o: in function `readInt()':
grader.cpp:(.text+0x0): multiple definition of `readInt()'; /tmp/ccKGa8wK.o:bubblesort2.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccYZozNH.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccKGa8wK.o:bubblesort2.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccKGa8wK.o: in function `main':
bubblesort2.cpp:(.text.startup+0x181): undefined reference to `countScans(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: /tmp/ccYZozNH.o: in function `main':
grader.cpp:(.text.startup+0x181): undefined reference to `countScans(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status