Submission #528324

#TimeUsernameProblemLanguageResultExecution timeMemory
528324CyanmondScales (IOI15_scales)C++17
0 / 100
1 ms300 KiB
// clang-format off
#include "scales.h"
#include <bits/stdc++.h>

void init(int T) {
    /* ... */
}

void orderCoins() {
    std::array<int, 3> A, B;
    {
        const int x = getHeaviest(1, 2, 3);
        const int y = getLightest(1, 2, 3);
        int z = 0;
        for (int i = 1; i <= 3; ++i) {
            if (i != x and i != y) z = i;
        }
        A = {x, z, y};
    }
    {
        const int x = getHeaviest(4, 5, 6);
        const int y = getLightest(4, 5, 6);
        int z = 0;
        for (int i = 4; i <= 6; ++i) {
            if (i != x and i != y) z = i;
        }
        B = {x, z, y};
    }

    std::vector<int> res(3);
    for (int i = 0; i < 3; ++i) res[i] = A[i];
    for (int i = 4; i <= 6; ++i) {
        const int m = getNextLightest(1, 2, 3, i);
        res.insert(std::find(res.begin(), res.end(), m), i);
    }

    int gb[6];
    for (int i = 0; i < 6; ++i) gb[i] = res[i];
    answer(gb);
}

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:5:15: warning: unused parameter 'T' [-Wunused-parameter]
    5 | void init(int T) {
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...