Submission #520082

#TimeUsernameProblemLanguageResultExecution timeMemory
520082pisikakaScales (IOI15_scales)C++17
Compilation error
0 ms0 KiB
#include "scales.h"

void init(int T) {
}

void orderCoins() {
    int W[] = {1, 2, 3, 4, 5, 6}, ans[6];
  	w[0] = getLightest(1,2,3);
  	w[1] = getMedian(1,2,3);
  	w[2] = (w[0]!=1&&w[1]!=1?1 : (w[0]!=2&&w[1]!=2 ? 2 : 3));
  	w[4] = getMedian(4,5,6);
  	w[5] = getHeaviest(4, 5 ,6);
	w[3] = (w[4]!=1&&w[5]!=1?1 : (w[4]!=2&&w[5]!=2 ? 2 : 3));
	int a = getLightest(w[2], w[3], w[5]), b = getHeaviest(w[2],w[3],w[0]);
  	w[2] = a;
  	w[3] = b;
  	ans[0] = getLightest(w[0],w[2],w[4]);
  	ans[2] = getMedian(w[0],w[2],w[4]);
 	ans[4] = getHeaviest(w[0],w[2],w[4]);
  	ans[1] = getLightest(w[1],w[3],w[5]);
  	ans[3] = getMedian(w[1],w[3],w[5]);
 	ans[5] = getHeaviest(w[1],w[3],w[5]);
  	answer(ans);
  	return;
}

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:3:15: warning: unused parameter 'T' [-Wunused-parameter]
    3 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:8:4: error: 'w' was not declared in this scope
    8 |    w[0] = getLightest(1,2,3);
      |    ^
scales.cpp:16:11: error: 'b' was not declared in this scope
   16 |    w[3] = b;
      |           ^
scales.cpp:7:9: warning: unused variable 'W' [-Wunused-variable]
    7 |     int W[] = {1, 2, 3, 4, 5, 6}, ans[6];
      |         ^