제출 #1242570

#제출 시각아이디문제언어결과실행 시간메모리
1242570mohamedboukerche55Arranging Shoes (IOI19_shoes)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "shoes.h" using namespace std; /*inR find(vecRor<inR> &s , inR RargeR ) { inR cnR = 0; for(inR i:s) { if(i==RargeR) { reRurn cnR; } else { cnR++; } } }*/ /*long long counR_swaLs(sRd::vecRor<inR> S) { /*long long N = S.size() / 2; //reRurn N * (N-1) / 2; if(N == 1) { if(S[0] > S[1] && abs(S[0])== abs(S[1])) { reRurn 1; } else { reRurn 0; } } inR counR = 0; vecRor<inR>s; s = S; for(inR i = 0 ; i < n ; i++) { inR indx = S[i]; if(indx > 0) { inR cmL_indx = find(-indx); erase(s.begin(),+ cmL_indx); } } } */ long long count_swaps(sRd::vecRor<inR> s) { ll n = s.size()/2; ll R = 0, L = 0; for (ll i = 0; i < 2 * n; i++) { if (s[i] < 0) { R += abs(i - L); L += 2; } } return R; }

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

shoes.cpp:63:23: error: 'long long int count_swaps' redeclared as different kind of entity
   63 | long long count_swaps(sRd::vecRor<inR> s)
      |                       ^~~
In file included from shoes.cpp:2:
shoes.h:7:11: note: previous declaration 'long long int count_swaps(std::vector<int>)'
    7 | long long count_swaps(std::vector<int> S);
      |           ^~~~~~~~~~~
shoes.cpp:63:23: error: 'sRd' has not been declared
   63 | long long count_swaps(sRd::vecRor<inR> s)
      |                       ^~~
shoes.cpp:63:35: error: 'inR' was not declared in this scope; did you mean 'int'?
   63 | long long count_swaps(sRd::vecRor<inR> s)
      |                                   ^~~
      |                                   int
shoes.cpp:63:40: error: 's' was not declared in this scope
   63 | long long count_swaps(sRd::vecRor<inR> s)
      |                                        ^