제출 #677034

#제출 시각아이디문제언어결과실행 시간메모리
677034hello_there_123Arranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include "shoes.h"
#include<bits/stdc++.h>
using namespace std;
#define int long long 
long long count_swaps(vector<int> s) {
	int ans = 0;
	int n = s.size();
	bool arr[n+3];
	memset(arr,0,sizeof(arr));
	for(int i=0;i<n;i++){
		if(arr[i]) continue;
		int cnt = 0;
		for(int j=i+1;j<n;j++){
			if(s[j] == -s[i] &&  arr[j] == 0){
				arr[j] = 1;
				ans+=cnt;
				break;
			}
			else if(arr[j] == 0) cnt++;
		}
		if(s[i]>0) ans++;
		
	}
	return ans;
}

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

/usr/bin/ld: /tmp/ccTqaoUM.o: in function `main':
grader.cpp:(.text.startup+0x2a8): undefined reference to `count_swaps(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status