Submission #151204

#TimeUsernameProblemLanguageResultExecution timeMemory
151204outsiderArranging Shoes (IOI19_shoes)C++17
Compilation error
0 ms0 KiB
#include "shoes.h" #include <bits/stdc++.h> #define ll int #define x first4 #define y second using namespace std; ll count_swaps(vector<int> a){ ll ans=0; ll n=a.size()/2; a.push_front(0); for (int i=1;i<=2*n;i++) { ll mt=0; for (ll k=i+1;k<=2*n;k++) { if (a[k]==-a[i]) { ans+=mt; if (a[i]>0)ans++; a[k]=0; break; } else if (a[k]!=0)mt++; } } return ans; }

Compilation message (stderr)

shoes.cpp: In function 'int count_swaps(std::vector<int>)':
shoes.cpp:7:4: error: ambiguating new declaration of 'int count_swaps(std::vector<int>)'
 ll count_swaps(vector<int> a){
    ^~~~~~~~~~~
In file included from shoes.cpp:1:0:
shoes.h:7:11: note: old declaration 'long long int count_swaps(std::vector<int>)'
 long long count_swaps(std::vector<int> S);
           ^~~~~~~~~~~
shoes.cpp:10:3: error: 'class std::vector<int>' has no member named 'push_front'; did you mean 'push_back'?
 a.push_front(0);
   ^~~~~~~~~~
   push_back