Submission #314195

#TimeUsernameProblemLanguageResultExecution timeMemory
314195ShiftyBlockArranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "shoes.h" #define rep(i,a,b) for(int i=a; i<b; i++) // #define int long long using namespace std; int count_swaps(vector<int> arr){ int N=arr.size(); int total=0; for (int i = 0; i < N; ++i) { if(arr[i]==0) continue; int free=0; int end=-1; rep(j,i+1,N){ if(arr[j]==-arr[i]){ end=j; break; } if(arr[j]==0) free++; } arr[end]=0; if(arr[i]<0) total--; total+=end-i; } return total; }

Compilation message (stderr)

shoes.cpp:6:5: error: ambiguating new declaration of 'int count_swaps(std::vector<int>)'
    6 | int count_swaps(vector<int> arr){
      |     ^~~~~~~~~~~
In file included from shoes.cpp:2:
shoes.h:7:11: note: old declaration 'long long int count_swaps(std::vector<int>)'
    7 | long long count_swaps(std::vector<int> S);
      |           ^~~~~~~~~~~