Submission #340606

#TimeUsernameProblemLanguageResultExecution timeMemory
340606israeladewuyiArranging Shoes (IOI19_shoes)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pair<int,int>> vp;
#define PB push_back
#define pb pop_back
#define in insert 
#define endl "\n"
#define MP make_pair
#define f first
#define Trav(a,x) for(auto& a: x)
const unsigned int M = 1000000007;
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n; cin>>n; 
	vi v(2 * n);
	Trav(a,v)cin>>a;
	int mxs = 0;
	
	for(int i = 0; i < (2 * n)-1; i++){
		int y = v[i];
		for(int j = i + 1; j<2*n; j++){
			if(v[j] == y){
				while(v[i+1] != y){
					swap(v[j],v[j-1]);
					mxs++;
					j = j-1;
				}
			}
		}
	}
	cout<<mxs<<endl;
	return 0;
}

Compilation message (stderr)

/tmp/cckGn0d7.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cciTBzEr.o:shoes.cpp:(.text.startup+0x0): first defined here
/tmp/cckGn0d7.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