Submission #1219899

#TimeUsernameProblemLanguageResultExecution timeMemory
1219899islam_2010Arranging Shoes (IOI19_shoes)C++20
Compilation error
0 ms0 KiB
#include "shoes.h" 
#include <bits/stdc++.h>
using namespace std;

long long count_swaps(vector<int> s){
    int n = s.size();
    vector<pair<int, int>> v;
    int c = 0;
    for(int i = 0; i < n/2; i++){
        for(int j = n/2 ; j < n; j++){
            if(abs(s[i])==abs(s[j])){
                c += (j-i-1);
                break;
            }
        } 
    }return c;
}

signed main(){
    int n;
    cin >> n;
    vector<int> v(n*2);
    for(int i = 0; i < 2*n; i++){
        cin >> v[i];
    }cout << count_swaps(v);

}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccFEL26S.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccFXuf2o.o:shoes.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status