Submission #1101178

#TimeUsernameProblemLanguageResultExecution timeMemory
1101178AvianshScales (IOI15_scales)C++17
0 / 100
1 ms596 KiB
#include "scales.h"
#include <bits/stdc++.h>

using namespace std;

void init(int T) {

}

void placemin(int W[], int st){
    //cout << "getting lightest in : " << W[st] << " " << W[st+1] << " " << W[st+2] << "\n";
    int a = getLightest(W[st],W[st+1],W[st+2]);
    //cout << a << "\n";
    if(a==W[st+1]){
        //cout << "swapped" << st+1 << " " << st << "\n";
        swap(W[st+1],W[st]);
    }
    if(a==W[st+2]){
        //cout << "swapped" << st+2 << " " << st << "\n";
        swap(W[st+2],W[st]);
    }
    for(int i = 0;i<6;i++){
        //cout << W[i] << " ";
    }
    //cout << "\n";
}

void orderCoins() {
    /* ... */
    int W[] = {1, 2, 3, 4, 5, 6};
    placemin(W,0);
    placemin(W,1);
    placemin(W,2);
    placemin(W,3);
    int a = getHeaviest(W[3],W[4],W[5]);
    if(W[5]!=a){
        swap(W[4],W[5]);
    }
    answer(W);
}

Compilation message (stderr)

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