Submission #1204047

#TimeUsernameProblemLanguageResultExecution timeMemory
1204047arkanefuryArranging Shoes (IOI19_shoes)C++20
Compilation error
0 ms0 KiB
#include "shoes"
using namespace std;
const int N = 2e5+5;
int a[N], b[N];
int64 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 b[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:1: error: 'int64' does not name a type; did you mean 'int'?
    5 | int64 count_swaps(vector<int>v){
      | ^~~~~
      | int