제출 #305984

#제출 시각아이디문제언어결과실행 시간메모리
305984amunduzbaevArranging Shoes (IOI19_shoes)C++14
컴파일 에러
0 ms0 KiB
#include "shoes.h"
#include <bits/stdc++.h>
#include "grader.cpp"
using namespace std;

long long count_swaps(vector<int> a) {
    int n=a.size()/2;

    long long ns=0;
    for(int i=0;i<n;i++){
        if(a[i*2]+a[i*2+1]==0){
            if(a[i*2]>a[i*2+1]){
                swap(a[i*2],a[i*2+1]);
                ns++;
            }
            continue;
        }
        int j;
        for(j=2*i+1;j<2*n;j++){
            if(a[j]+a[i*2]==0)
                break;
        }
        int l=j-1;
        int q=(a[j]<0 ? 1:0);
        while(l>i-q){
            swap(a[l],a[l+1]);
            ns++;
            l--;
        }
        
    }
    
	return ns;
}

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

/tmp/cctEkvz2.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccBuslvD.o:shoes.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status