제출 #339384

#제출 시각아이디문제언어결과실행 시간메모리
339384israeladewuyiArranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
#define PB push_back
#define pb pop_back
#define in insert 
#define endl "\n"
const unsigned int M = 1000000007;

ll count_swaps(vi s){
	int n = s.size();
	int swaps = 0;
	for(int i = 0; i < n;i+=2){
		int x = abs(s[i+1]);
		if(v[i] != -x)swaps++;
	}
	return swaps;
}

//int main(){
//	vi v;
//	v.PB(2);
//	v.PB(-2);
//	cout<<count_swaps(v);
//}

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

shoes.cpp: In function 'll count_swaps(vi)':
shoes.cpp:18:6: error: 'v' was not declared in this scope
   18 |   if(v[i] != -x)swaps++;
      |      ^