Submission #650195

#TimeUsernameProblemLanguageResultExecution timeMemory
650195ojoConmigoScales (IOI15_scales)C++17
45.45 / 100
1 ms304 KiB
#include "scales.h"
#include <iostream>
using namespace std;

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

void orderCoins() {
    /* ... */
    int W[6];
    int q = getLightest(1,2,3);
    q = getLightest(q,4,5);
    if(q != 5)q = getLightest(q,q+1,6);
    else q = getLightest(q,q-1,6);
    W[0] = q;
    int k[3];
    int t=0;
    for(int i=1; i<=6; i++){
        if(i != W[0]){
            k[t++] = i;
        }
        if(t == 3){
            q = getLightest(k[0],k[1],k[2]);
            t = 1;
            k[0] = q;
        }
        if(i == 6) W[1] = q;
    }
    t=0;
    for(int i=1; i<=6; i++){
        if(i != W[0] && i!=W[1]){
            k[t++] = i;
        }
        if(t == 3){
            q = getLightest(k[0],k[1],k[2]);
            t = 2;
            k[0] = q;
            if(k[1] == q){
                k[1] = k[2];
            }
        }
        if(i == 6) W[2] = q;
    }
    t=0;
    for(int i=1; i<=6; i++){
        if(i != W[0] && i != W[1] && i != W[2]){
            k[t++] = i;
        }
    }
    W[3] = getLightest(k[0],k[1],k[2]);
    W[4] = getMedian(k[0],k[1],k[2]);
    for(int i=1; i<=6; i++){
        bool b = true;
        for(int j=0; j<5; j++){
            if(i == W[j]){
                b = false;
            }
        }
        if(b){
            W[5] = i;
            break;
        }
    }
    answer(W);
}

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...