Submission #1068475

#TimeUsernameProblemLanguageResultExecution timeMemory
1068475ArthuroWichScales (IOI15_scales)C++17
45.45 / 100
1 ms600 KiB
#include "scales.h"
#include<bits/stdc++.h>
using namespace std;
void init(int T) {
    
}
void orderCoins() {
    int W[6];
    vector<int> a = {1, 2, 3, 4, 5, 6};
    int j = 0;
    while(a.size() != 3) {
        int sh = getLightest(a[0], a[1], a[2]);
        if (a.size() == 4) {
             if (sh != a[0]) {
                sh = getLightest(sh, a[0], a[3]);
            } else {
                sh = getLightest(sh, a[1], a[3]);
            }
        } else if (a.size() == 5) {
            sh = getLightest(sh, a[3], a[4]);
        } else if (a.size() == 6) {
            sh = getLightest(sh, a[3], a[4]);
            if (sh != a[0]) {
                sh = getLightest(sh, a[0], a[5]);
            } else {
                sh = getLightest(sh, a[1], a[5]);
            }
            
        }
        W[j] = sh;
        j++;
        a.erase(find(a.begin(), a.end(), sh));
    }
    W[j] = getLightest(a[0], a[1], a[2]);
    j++;
    W[j] = getMedian(a[0], a[1], a[2]);
    j++;
    a.erase(find(a.begin(), a.end(), W[j-1]));
    a.erase(find(a.begin(), a.end(), W[j-2]));
    W[j] = a[0];
    answer(W);
}

Compilation message (stderr)

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