Submission #1325360

#TimeUsernameProblemLanguageResultExecution timeMemory
1325360minh30082008Scales (IOI15_scales)C++20
Compilation error
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);
}

Compilation message (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