제출 #580414

#제출 시각아이디문제언어결과실행 시간메모리
580414alireza_kaviani저울 (IOI15_scales)C++17
55.56 / 100
1 ms340 KiB
#include "scales.h"
#include <bits/stdc++.h>

void init(int T) {

}

void Sort3(int &A , int &B , int &C){
    int x = A , y = B , z = C;
    int res = getMedian(x , y , z);
    if(res == x){
        A = z; B = x; C = y;
    }
    if(res == y){
        A = x; B = y; C = z;
    }
    if(res == z){
        A = x; B = z; C = y;
    }
}

void orderCoins() {
    int ax = getLightest(1 , 2 , 3);
    int az = getHeaviest(1 , 2 , 3);
    int ay = 1 + 2 + 3 - ax - az;
    int bx = getLightest(4 , 5 , 6);
    int bz = getHeaviest(4 , 5 , 6);
    int by = 4 + 5 + 6 - bx - bz;

    int W[6] = {ax , ay , bx , by , bz , az};
    Sort3(W[0] , W[1] , W[2]);
    Sort3(W[3] , W[4] , W[5]);
    Sort3(W[1] , W[2] , W[3]);
    Sort3(W[2] , W[3] , W[4]);
    answer(W);
}

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