Submission #888548

#TimeUsernameProblemLanguageResultExecution timeMemory
888548Lincito_31Arranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
using namespace std; #include <bits/stdc++.h> #include "shoes.h" long long x; int64_t count_swaps(vector<int> s) { //x=s.size(); //x/=2; /*if(x==1){ return s[0]<0?0:1; }else{ x=x*(x-1)/2; return x; */ while(!s.empty()){ long long i=0; while(s[i]>0){ i++; } x+=i; long long abso=-1*s[i]; vector<int> ant(s.begin(),s.begin()+i); vector<int> pos(s.begin()+i+1,s.end()); ant.insert(ant.end(),pos.begin(),pos.end()); s=ant; i=0; while(s[i]!=abso){ i++; } x+=i; vector<int> ante(s.begin(),s.begin()+i); vector<int> post(s.begin()+i+1,s.end()); ante.insert(ante.end(),post.begin(),post.end()); s=ante; } return x; }

Compilation message (stderr)

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