Submission #339374

#TimeUsernameProblemLanguageResultExecution timeMemory
339374israeladewuyiArranging Shoes (IOI19_shoes)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<ll> vi;
typedef vector<string> vs;
#define PB push_back
#define pb pop_back
#define in insert 
#define endl "\n"
const unsigned int M = 1000000007;

ll count_swaps(vi v){
	int n = v.size();
	int swaps = 0;
	for(int i = 0; i < n;i+=2){
		int x = abs(v[i+1]);
		if(v[i] != -x)swaps++;
	}
	return swaps;
}

//int main(){
//	vi v;
//	v.PB(2);
//	v.PB(-2);
//	cout<<count_swaps(v);
//}

Compilation message (stderr)

/tmp/cclL9Nw3.o: In function `main':
grader.cpp:(.text.startup+0x28e): undefined reference to `count_swaps(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status