Submission #894528

#TimeUsernameProblemLanguageResultExecution timeMemory
894528ozner77Arranging Shoes (IOI19_shoes)C++17
Compilation error
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);
}

Compilation message (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;
      |         ^~~~~