제출 #894528

#제출 시각아이디문제언어결과실행 시간메모리
894528ozner77Arranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include "shoes.h" #include "bits/stdc++.h" using namespace std; long long count_swaps(std::vector<int> s) { if(s[0]<0){ swaps=0; }else{ swaps=1; } return swaps; } int main(){ int a,b; vector<int> V; cin>>a; for(int i=0;i<a*2;i++){ cin>>b; V.push_back(b); } cout << count_swaps(V); }

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

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:6:9: error: 'swaps' was not declared in this scope
    6 |         swaps=0;
      |         ^~~~~
shoes.cpp:8:9: error: 'swaps' was not declared in this scope
    8 |         swaps=1;
      |         ^~~~~
shoes.cpp:10:9: error: 'swaps' was not declared in this scope
   10 |  return swaps;
      |         ^~~~~