제출 #791801

#제출 시각아이디문제언어결과실행 시간메모리
791801JosiaScales (IOI15_scales)C++17
45.45 / 100
1 ms300 KiB
#include "scales.h"
using namespace std;
#include <bits/stdc++.h>


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

void orderCoins() {
    int a1 = getLightest(1, 2, 3);
    int a2 = getMedian(1, 2, 3);
    set<int> a = {1,2,3};
    a.erase(a1);
    a.erase(a2);
    int a3 = *a.begin();


    int b1 = getLightest(4,5,6);
    int b2 = getMedian(4,5,6);
    set<int> b = {4,5,6};
    b.erase(b1);
    b.erase(b2);
    int b3 = *b.begin();



    deque<int> A, B;
    A = {a1, a2, a3};
    B = {b1, b2, b3};
    
    vector<int> res;

    res.push_back(getLightest(A[0], A[1], B[0]));
    if (res[0] == B[0]) B.pop_front();
    else A.pop_front();

    while (A.size() && B.size()) {
        res.push_back(getMedian(res[0], A[0], B[0]));
        if (res.back() == B[0]) B.pop_front();
        else A.pop_front();
    }
    for (int i:A) res.push_back(i);
    for (int i:B) res.push_back(i);


    int W[] = {1,2,3,4,5,6};

    for (int i = 0; i<6; i++) {
        W[i] = res[i];
        // cerr << res[i] << " ";
    }
    // cerr << "\n";

    answer(W);
}

컴파일 시 표준 에러 (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...