제출 #154247

#제출 시각아이디문제언어결과실행 시간메모리
154247popovicirobert저울 (IOI15_scales)C++14
55.56 / 100
8 ms376 KiB
#include "scales.h"
#include <bits/stdc++.h>

using namespace std;

void init(int T) {

}

void orderCoins() {
    vector <int> a, b;
    int z = getHeaviest(1, 2, 3), x = getLightest(1, 2, 3);
    int y = 6 - x - z;
    a = {x, y, z};

    z = getHeaviest(4, 5, 6), x = getLightest(4, 5, 6);
    y = 15 - x - z;
    b = {x, y, z};

    int mx = getHeaviest(a[0], a[2], b[2]);
    int sol[6], i;

    if(mx == a[2]) {
        vector <int> pos(3);
        for(i = 0; i < 3; i++) {
            pos[i] = getNextLightest(a[0], a[1], a[2], b[i]);
        }
        int p = 0, sz = 0;
        for(i = 0; i < 3; i++) {
            while(p < 3 && pos[p] == a[i]) {
                sol[sz++] = b[p++];
            }
            sol[sz++] = a[i];
        }
    }
    else {
        vector <int> pos(3);
        for(i = 0; i < 3; i++) {
            pos[i] = getNextLightest(b[0], b[1], b[2], a[i]);
        }
        int p = 0, sz = 0;
        for(i = 0; i < 3; i++) {
            while(p < 3 && pos[p] == b[i]) {
                sol[sz++] = a[p++];
            }
            sol[sz++] = b[i];
        }
    }

    answer(sol);
}

컴파일 시 표준 에러 (stderr) 메시지

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