제출 #63286

#제출 시각아이디문제언어결과실행 시간메모리
63286hamzqq9Scales (IOI15_scales)C++14
0 / 100
4 ms908 KiB
#include "scales.h"

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

void orderCoins() {

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

    int mn1=getLightest(1,2,3);
    int mx1=getHeaviest(1,2,3);
    int md1=6-mn1-mx1;

    W[0]=mn1;W[1]=md1;W[2]=mx1;

    int mn2=getLightest(4,5,6);
    int mx2=getHeaviest(4,5,6);
    int md2=15-mn2-mx2;

    W[3]=mn2;W[4]=md2;W[5]=mx2;    

    int bas1=0,bas2=3;

    int TMP[6];

    int cur=0;

    while(bas1<3 || bas2<6) {

    	if(bas1+1<3) {

    		int mn=getLightest(W[bas1],W[bas1+1],W[bas2]);

    		if(mn==W[bas1]) {

    			TMP[cur++]=W[bas1++];

    		}
    		else {

    			TMP[cur++]=W[bas2++];

    		}

    	}
    	else if(bas2+1<6) {

    		int mn=getLightest(W[bas1],W[bas2+1],W[bas2]);

    		if(mn==W[bas1]) {

    			TMP[cur++]=W[bas1++];

    		}
    		else {

    			TMP[cur++]=W[bas2++];

    		}

    	}
    	else {

    		int mx=getHeaviest(W[bas1],W[bas2],TMP[0]);

    		if(mx==W[bas1]) {

    			TMP[cur++]=W[bas2++];
    			TMP[cur++]=W[bas1++];

    		}
    		else {

    			TMP[cur++]=W[bas1++];
    			TMP[cur++]=W[bas2++];

    		}

    	}

    }

    answer(TMP);

}

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

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'void init(int)':
scales.cpp:3:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...