제출 #1144599

#제출 시각아이디문제언어결과실행 시간메모리
1144599crispxxArranging Shoes (IOI19_shoes)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "shoes.h"

#include "grader.cpp"

using namespace std;

#define all(x) x.begin(), x.end()
#define pb push_back
#define nl '\n'

long long count_swaps(vector<int> s) {
	int n = s.size();
	
	long long ans = 0;
	
	for(int i = 0; i < n; i++) {
		if(i % 2 != (s[i] > 0)) {
			int k = -1;
			
			for(int j = i; j < n; j++) {
				if(s[j] == -s[i]) {
					k = j;
					break;
				}
			}
			
			for(int j = k; j > i; j--) {
				swap(s[j], s[j - 1]);
			}
			
			ans += k - i;
		}
		
	}
	
	return ans;
}

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

/usr/bin/ld: /tmp/ccJQyXj9.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccvGeJdp.o:shoes.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status