Submission #285664

#TimeUsernameProblemLanguageResultExecution timeMemory
285664Otaku619Arranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int vect[2 * n]; for (int i = 0; i < 2 * n; i++) cin >> vect[i]; int swa = 0; for (int i = 0; i < 2 * n; i += 2) { for (int j = i + 1; j < 2 * n; j++) { if (abs(vect[j]) == abs(vect[i])) { for (int k = j; k > i + 1; k--) swap(vect[k], vect[k - 1]); swa += (j - 1 - i); if (vect[i + 1] < 0) { swap(vect[i], vect[i + 1]); swa++; } break; } } } cout << swa; return 0; }

Compilation message (stderr)

/tmp/ccAFN1jF.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccz0BSC6.o:shoes.cpp:(.text.startup+0x0): first defined here
/tmp/ccAFN1jF.o: In function `main':
grader.cpp:(.text.startup+0x26a): undefined reference to `count_swaps(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status