Submission #290796

#TimeUsernameProblemLanguageResultExecution timeMemory
290796arayiScales (IOI15_scales)C++17
0 / 100
1 ms384 KiB
#include <bits/stdc++.h>
#include "scales.h"
#define vii vector <int>
#define ad push_back
using namespace std;

void init(int T) {

}
int a[6];
vii fp[7];
void orderCoins() {
    a[0] = getLightest(1, 2, 3);
    a[1] = getMedian(1, 2, 3);
    a[2] = 6 - a[0] - a[1];
    a[3] = getLightest(4, 5, 6);
    a[4] = getMedian(4, 5, 6);
    a[5] = 15 - a[3] - a[4];
    int sm;
    sm = getNextLightest(1, 2, 3, a[4]);
    if(sm == a[0])
    {

    }
    else
    {
        fp[sm].push_back(a[4]);
        int ss;
        ss = getNextLightest(1, 2, 3, a[3]);
        fp[ss].ad(a[3]);
        swap(fp[ss][0], fp[ss].back());
        ss = getNextLightest(1, 2, 3, a[5]);
        if(ss == a[0]) ss = 4;
        fp[ss].ad(a[5]);
    }
    int W[] = {1, 2, 3, 4, 5, 6};
    int i1 = 0;
    for(int i : {0, 1, 2})
    {
        for(auto p : fp[a[i]]) W[i1++] = p;
        W[i1++] = a[i];
    }
    for(auto p : fp[4]) W[i1++] = p;
    answer(W);
}

Compilation message (stderr)

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