Submission #471995

#TimeUsernameProblemLanguageResultExecution timeMemory
471995nicholaskScales (IOI15_scales)C++14
Compilation error
0 ms0 KiB
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
void init(int T){}
int r1,r2;
void orderCoins() {
	vector <int> v;
	r1=getHeaviest(1,2,3);
	r2=getLightest(1,2,3);
	v.push_back(r2);
	v.push_back(6-r1-r2);
	v.push_back(r1);
	r1=getNextLighest(v[0],v[1],v[2],4);
	if (r1==v[0]){
		r1=getLightest(4,v[0],v[1]);
		if (r1==4) ans.insert(ans.begin(),4);
		else ans.push_back(4);
	} else if (r1==v[1]){
		ans.insert(ans.begin()+1,4);
	} else {
		ans.insert(ans.begin()+2,4);
	}
	r1=getNextLighest(v[0],v[2],v[3],5);
	if (r1==v[0]){
		r1=getLighest(5,v[0],v[1]);
		if (r1==5) ans.insert(ans.begin(),5);
		else ans.push_back(5);
	} else if (r1==v[2]){
		r1=getLighest(5,v[1],v[2]);
		if (r1==5) ans.insert(ans.begin()+1,5);
		else ans.insert(ans.begin()+2,5);
	} else {
		ans.insert(ans.begin()+3,5);
	}
	r1=getNextLighest(v[0],v[2],v[4]);
	if (r1==v[0]){
		r1=getLighest(6,v[0],v[1]);
		if (r1==6) ans.insert(ans.begin(),6);
		else ans.push_back(6);
	} else if (r1==v[2]){
		r1=getLighest(6,v[1],v[2]);
		if (r1==6) ans.insert(ans.begin()+1,6);
		else ans.insert(ans.begin()+2,6);
	} else {
		r1=getLighest(6,v[3],v[4]);
		if (r1==6) ans.insert(ans.begin()+3,6);
		else ans.insert(ans.begin()+4,6);
	}
	int W[6];
	for (int i=0; i<6; i++) W[i]=ans[i];
	answer(W);
}

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:4:15: warning: unused parameter 'T' [-Wunused-parameter]
    4 | void init(int T){}
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:13:5: error: 'getNextLighest' was not declared in this scope; did you mean 'getNextLightest'?
   13 |  r1=getNextLighest(v[0],v[1],v[2],4);
      |     ^~~~~~~~~~~~~~
      |     getNextLightest
scales.cpp:16:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   if (r1==4) ans.insert(ans.begin(),4);
      |              ^~~
      |              abs
scales.cpp:17:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |   else ans.push_back(4);
      |        ^~~
      |        abs
scales.cpp:19:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |   ans.insert(ans.begin()+1,4);
      |   ^~~
      |   abs
scales.cpp:21:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |   ans.insert(ans.begin()+2,4);
      |   ^~~
      |   abs
scales.cpp:25:6: error: 'getLighest' was not declared in this scope; did you mean 'getLightest'?
   25 |   r1=getLighest(5,v[0],v[1]);
      |      ^~~~~~~~~~
      |      getLightest
scales.cpp:26:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |   if (r1==5) ans.insert(ans.begin(),5);
      |              ^~~
      |              abs
scales.cpp:27:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |   else ans.push_back(5);
      |        ^~~
      |        abs
scales.cpp:29:6: error: 'getLighest' was not declared in this scope; did you mean 'getLightest'?
   29 |   r1=getLighest(5,v[1],v[2]);
      |      ^~~~~~~~~~
      |      getLightest
scales.cpp:30:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |   if (r1==5) ans.insert(ans.begin()+1,5);
      |              ^~~
      |              abs
scales.cpp:31:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |   else ans.insert(ans.begin()+2,5);
      |        ^~~
      |        abs
scales.cpp:33:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |   ans.insert(ans.begin()+3,5);
      |   ^~~
      |   abs
scales.cpp:37:6: error: 'getLighest' was not declared in this scope; did you mean 'getLightest'?
   37 |   r1=getLighest(6,v[0],v[1]);
      |      ^~~~~~~~~~
      |      getLightest
scales.cpp:38:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |   if (r1==6) ans.insert(ans.begin(),6);
      |              ^~~
      |              abs
scales.cpp:39:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |   else ans.push_back(6);
      |        ^~~
      |        abs
scales.cpp:41:6: error: 'getLighest' was not declared in this scope; did you mean 'getLightest'?
   41 |   r1=getLighest(6,v[1],v[2]);
      |      ^~~~~~~~~~
      |      getLightest
scales.cpp:42:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   42 |   if (r1==6) ans.insert(ans.begin()+1,6);
      |              ^~~
      |              abs
scales.cpp:43:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |   else ans.insert(ans.begin()+2,6);
      |        ^~~
      |        abs
scales.cpp:45:6: error: 'getLighest' was not declared in this scope; did you mean 'getLightest'?
   45 |   r1=getLighest(6,v[3],v[4]);
      |      ^~~~~~~~~~
      |      getLightest
scales.cpp:46:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |   if (r1==6) ans.insert(ans.begin()+3,6);
      |              ^~~
      |              abs
scales.cpp:47:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   47 |   else ans.insert(ans.begin()+4,6);
      |        ^~~
      |        abs
scales.cpp:50:31: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |  for (int i=0; i<6; i++) W[i]=ans[i];
      |                               ^~~
      |                               abs