제출 #1325360

#제출 시각아이디문제언어결과실행 시간메모리
1325360minh30082008저울 (IOI15_scales)C++20
컴파일 에러
0 ms0 KiB
#include "scales.h"
#include <algorithm>

bool heavier(int a, int b) {
    int c = 1;
    while (c == a || c == b) c++;
    int h = getHeaviest(a, b, c);
    return (h == a);
}

void orderCoins() {
    int w[6] = {1, 2, 3, 4, 5, 6};

    // bubble sort
    for (int i = 0; i < 6; i++) {
        for (int j = i + 1; j < 6; j++) {
            if (heavier(w[i], w[j])) {
                std::swap(w[i], w[j]);
            }
        }
    }

    answer(w);
}

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

/usr/bin/ld: /tmp/ccZh53iW.o: in function `main':
grader.c:(.text.startup+0x8a): undefined reference to `init'
collect2: error: ld returned 1 exit status