제출 #206396

#제출 시각아이디문제언어결과실행 시간메모리
206396batmend저울 (IOI15_scales)C++14
0 / 100
5 ms376 KiB
#include "scales.h"
#include<bits/stdc++.h>
using namespace std;

int ma;
int med;
int val0, val1, val2, val3;


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

void orderCoins() {
    /* ... */
    int pos[7] = {0, 0, 1, 2, 3, 4, 5};
    int W[6] = {1, 2, 3, 4, 5, 6};
	/*
    ma = getHeaviest(1, 2, 3);
    swap(W[ma], W[2]);
    swap(pos[ma], pos[2]);
    ma = getHeaviest(4, 5, 6);
    swap(W[ma], W[5]);
    swap(pos[ma], pos[5]);
    

    ma = getHeaviest(W[1], W[2], W[5]);
    bool w2wasmax = 0;
    if (ma == W[2]) {
    	swap(pos[W[2]], pos[W[5]]);
    	swap(W[2], W[5]);
    	w2wasmax = 1;
    }
    if (w2wasmax == 1) {
    	ma = getHeaviest(W[0], W[1], W[2]);
    }
    if (w2wasmax == 0) {
    	ma = getHeaviest(W[3], W[4], W[2]);
    }
    int val = W[4];
    swap(W[pos[ma]], W[4]);
    swap(pos[val], pos[ma]);

    ma = getHeaviest(W[1], W[2], W[3]);
    val = W[3];
    swap(W[pos[ma]], W[3]);
    swap(pos[ma], pos[val]);
    med = getMedian(W[0], W[1], W[3]);
    val0 = W[0];
    val1 = W[1];
    val3 = W[3];
    if (med == val0) {
		swap(pos[W[0]], pos[W[1]]);
		swap(W[0], W[1]);
    }
    if (med == val3) {
			swap(pos[W[3]], pos[W[0]]);
			swap(W[0], W[3]);
			swap(pos[W[3]], pos[W[1]]);
			swap(W[1], W[3]);
    }
    med = getMedian(W[0], W[1], W[2]);
    val0 = W[0];
    val1 = W[1]; 
    val2 = W[2];
	if (med == val0) {
			swap(pos[W[0]], pos[W[2]]);
			swap(W[0], W[2]);
			swap(pos[W[1]], pos[W[0]]);
			swap(W[1], W[0]);
    }
    if (med == val2) {
			swap(pos[W[1]], pos[W[2]]);
			swap(W[1], W[2]);
    }
    */
	answer(W);
}

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

scales.cpp: In function 'void init(int)':
scales.cpp:10:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:16:9: warning: unused variable 'pos' [-Wunused-variable]
     int pos[7] = {0, 0, 1, 2, 3, 4, 5};
         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...