Submission #1137059

#TimeUsernameProblemLanguageResultExecution timeMemory
1137059alterioScales (IOI15_scales)C++20
0 / 100
1 ms320 KiB
#include "scales.h"
#include <bits/stdc++.h>

using namespace std;

const int n = 6;

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

bool used[n];

vector<int> left() {
    vector<int> v;
    for (int i = 1; i <= n; i++) {
        if (!used[i]) v.push_back(i);
    }
    return v;
}

void orderCoins() {
    /* ... */
    int W[n];
    memset(used, 0, sizeof(used));
    int ans1 = getLightest(1, 2, 3), ans2 = getLightest(4, 5, 6);
    int other = 1;
    if (ans1 == other) other = 2;
    W[0] = getLightest(ans1, other, ans2);
    used[W[0]] = 1;
    vector<int> v = left();
    ans1 = getLightest(v[0], v[1], v[2]);
    W[1] = getLightest(ans1, v[3], v[4]);
    used[W[1]] = 1;
    v = left();
    ans1 = getLightest(v[0], v[1], v[2]);
    other = v[0];
    if (ans1 == other) other = v[1];
    W[2] = getLightest(ans1, other, v[3]);
    used[W[2]] = 1;
    v = left();
    W[3] = getLightest(v[0], v[1], v[2]);
    W[4] = getMedian(v[0], v[1], v[2]);
    W[5] = getHeaviest(v[0], v[1], v[2]);
    answer(W);
}
#Verdict Execution timeMemoryGrader output
Fetching results...