Submission #784132

#TimeUsernameProblemLanguageResultExecution timeMemory
784132AlfraganusArranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
// #include "shoes.h" #include "grader.cpp" #include <bits/stdc++.h> using namespace std; long long count_swaps(vector<int> a) { long long n = a.size() / 2; if(n == 1)return a[0] > 0; vector<vector<int>> pos(2 * n + 1); for(int i = 2 * n - 1; i >= 0; i --) pos[a[i] + n].push_back(i); long long ans = 0; for(int i = 0; i < 2 * n; i ++){ if(a[i] != 0){ ans += pos[-a[i] + n].back() - i; if(a[i] < 0)ans --; a[pos[-a[i] + n].back()] = 0; pos[-a[i] + n].pop_back(); pos[a[i] + n].pop_back(); a[i] = 0; } } return ans; }

Compilation message (stderr)

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