Submission #292381

#TimeUsernameProblemLanguageResultExecution timeMemory
292381VodkaInTheJarScales (IOI15_scales)C++14
0 / 100
1 ms256 KiB
#include <bits/stdc++.h>
#include "scales.h"
 
using namespace std;
 
 
void init(int t)
{
 
}
 
 
vector <int> order_it(int a, int b, int c)
{
	int temp = getMedian(a, b, c);
	if (temp == c)
	return {a, c, b};
	
	else 
	if (temp == a)
	return {c, a, b};
	
	else
	return {a, b, c};
}
 
int shit[6];
void orderCoins()
{
	vector <int> v1;
	v1.push_back(getLightest(1, 2, 3));
	v1.push_back(getMedian(1, 2, 3));
	
	if (1 != v1[0] && 1 != v1[1])
	v1.push_back(1);
	
	else
	if (2 != v1[0] && 2 != v1[1])
	v1.push_back(2);
	
	else
	v1.push_back(3);
	
	vector <int> v2;
	v2.push_back(getLightest(4, 5, 6));
	v2.push_back(getMedian(4, 5, 6));
	
	if (4 != v2[0] && 4 != v2[1])
	v2.push_back(4);
	
	else
	if (5 != v2[0] && 5 != v2[1])
	v2.push_back(5);
	
	else
	v2.push_back(6);
	 
	int t[3];
	t[0] = getNextLightest(v1[0], v1[1], v1[2], v2[0]);
	t[1] = getNextLightest(v1[0], v1[1], v1[2], v2[1]);
	t[2] = getNextLightest(v1[0], v1[1], v1[2], v2[2]);
	
	vector <int> ans; 
	if (t[0] == v1[0] && t[1] == v1[0] && t[2] == v1[0])
	{
		if (getLightest(v2[1], v2[2], v1[0]) == v1[0])
		{
			for (auto i: v1)
			ans.push_back(i);
			
			for (auto i: v2)
			ans.push_back(i);
		}
		
		else 
		{
			for (auto i: v2)
			ans.push_back(i);
			
			for (auto i: v1)
			ans.push_back(i);
		}
	}
	
	else
	{
		int pos = 0;
		for (int i = 0; i < 3; i++)
		{
			while (pos < 3 && t[i] == i)
			ans.push_back(v2[pos]), pos++;
			
			ans.push_back(v1[i]);
		}
	}
	
	for (int i = 0; i < 6; i++)
	shit[i] = ans[i];
	
	answer(shit);
}

Compilation message (stderr)

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