제출 #358312

#제출 시각아이디문제언어결과실행 시간메모리
358312kylych03Scales (IOI15_scales)C++14
0 / 100
3 ms364 KiB
#include "scales.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
void init(int T) {
    /* ... */
}

void orderCoins() {
    int w[] = {1, 2, 3, 4, 5, 6};
    ///
	int x = getLightest(w[0], w[1], w[2]);
    if ( x == w[2])
    	swap(w[0] , w[2]);
    if ( x == w[1])
    	swap(w[0] , w[1]);
    //	
	x = getMedian (w[0], w[1], w[2]);
    if ( x == w[2])
    	swap(w[2] , w[1]);
    //
	swap(w[0], w[3]);
    swap(w[1], w[4]);
    swap(w[2], w[5]);
    //
    x = getLightest(w[0], w[1], w[2]);
    if ( x == w[2])
    	swap(w[0] , w[2]);
    if ( x == w[1])
    	swap(w[0] , w[1]);
    //	
	x = getMedian (w[0], w[1], w[2]);
    if ( x == w[2])
    	swap(w[2] , w[1]);
    	
    x = getMedian (w[0], w[1], w[4]);
    if( x == w[0]){
    	swap(w[0] ,  w[3]);
    	swap(w[1] ,  w[4]);
    	swap(w[2] ,  w[3]);
    	swap(w[3] ,  w[4]);
    	x = getMedian (w[2], w[3], w[5]);
    	if(x == w[2]){
    		swap(w[5], w[2]);
			swap(w[5], w[3]);
			swap(w[5], w[4]);	
    	}
    	else
    	if(x == w[5]){
    		swap(w[5], w[3]);
			swap(w[5], w[4]);
    	}
    	else{
    		x = getMedian (w[3], w[4], w[5]);
			if( x == w[5])
				swap( w[4], w[5]);	
    	}
    	
    }
    else
    if(x == w[1]){
    	swap(w[1], w[3]);
    	swap(w[2], w[3]);
    	x = getMedian (w[0], w[1], w[2]);
    	if(x == w[0])
    		swap(w[0], w[1]);
    	if(x == w[2])
    		swap(w[2], w[1]);
    		
    	x = getMedian (w[3], w[4], w[5]);
    	
    	if(x == w[3]  || x == w[5])
    		swap( w[3], w[4]);
    	if( x == w[5])
    		swap( w[4], w[5]);
    }
    else
    {
    	swap(w[1], w[3]);
    	swap(w[2], w[4]);
    	x = getMedian (w[0], w[1], w[2]);
    	if(x == w[0])
    		swap(w[0], w[1]);
    	x = getMedian (w[3], w[4], w[5]);
    	if(x == w[3]){
    		
    		swap(w[3], w[5]);
    		swap(w[4], w[5]);
    	}
    	if( x == w[5])
    		swap(w[4], w[5]);
    }
    answer(w);
}

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

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