제출 #147080

#제출 시각아이디문제언어결과실행 시간메모리
147080youssan_williamArranging Shoes (IOI19_shoes)C++14
컴파일 에러
0 ms0 KiB
#include "shoes.h" #include <bits/stdc++.h> using namespace std; bool v[100005]; int count_swaps( vector<int>s ) { int n = s.size()/2 ; int ans=0; for(int i = 0 ; i <2*n ; i++) { if(!v[abs(s[i])]) { v[abs(s[i])]=1; for(int j =i+1 ; j <= 2 * n ;j++) { if(abs(s[i])==abs(s[j])) { for(int k=j-1 ; k>i ;k--) { swap(s[k],s[k+1]); ans++; } break; } } } } for(int i = 0 ; i <2*n ;i++ ) { if(i%2==0&&s[i]>s[i+1]) ans++; } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

shoes.cpp: In function 'int count_swaps(std::vector<int>)':
shoes.cpp:5:5: error: ambiguating new declaration of 'int count_swaps(std::vector<int>)'
 int count_swaps( vector<int>s )
     ^~~~~~~~~~~
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);
           ^~~~~~~~~~~