Submission #1204048

#TimeUsernameProblemLanguageResultExecution timeMemory
1204048arkanefuryArranging Shoes (IOI19_shoes)C++20
Compilation error
0 ms0 KiB
#include "shoes" using namespace std; const int N = 2e5+5; int a[N]; int count_swaps(vector<int>v){ int n = v.size(); for(int i = 0; i < n; i ++){ if(v[i] > 0)a[v[i]] = i; else a[v[i] * -1] = i; } int ans = 0, x = 0; for(int i = 1; i <= n/2; i ++){ ans += a[i] - x + b[i] - x - 1; x += 2; } return ans; }

Compilation message (stderr)

shoes.cpp:5:17: error: 'vector' was not declared in this scope
    5 | int count_swaps(vector<int>v){
      |                 ^~~~~~
shoes.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    1 | #include "shoes"
  +++ |+#include <vector>
    2 | using namespace std;
shoes.cpp:5:24: error: expected primary-expression before 'int'
    5 | int count_swaps(vector<int>v){
      |                        ^~~