제출 #373419

#제출 시각아이디문제언어결과실행 시간메모리
373419luciocfScales (IOI15_scales)C++14
0 / 100
1 ms512 KiB
#include <bits/stdc++.h>
#include "scales.h"

using namespace std;

void init(int T)
{
    
}

int a[4], b[4];
bool tem[7];

void orderCoins()
{
	for (int i = 0; i < 7; i++)
		tem[i] = 0;

	a[1] = getLightest(1, 2, 3);
	a[3] = getHeaviest(1, 2, 3);
	
	tem[a[1]] = tem[a[3]] = 1;

	if (!tem[1]) a[2] = 1;
	else if (!tem[2]) a[2] = 2;
	else a[2] = 3;

	b[1] = getLightest(4, 5, 6);
	b[3] = getHeaviest(4, 5, 6);
	
	tem[b[1]] = tem[b[3]] = 1;

	if (!tem[4]) b[2] = 4;
	else if (!tem[5]) b[2] = 5;
	else b[2] = 6;

	if (getLightest(a[1], b[1], b[3]) == b[3]) swap(a, b);

	if (getLightest(a[2], b[1], b[3]) == a[2])
	{
		if (getLightest(b[1], a[3], b[3]) == a[3])
		{
			int ans[6] = {a[1], a[2], a[3], b[1], b[2], b[3]};
			answer(ans);
		}
		else
		{
			int x = getMedian(b[2], b[3], a[3]);

			if (x == b[3])
			{
				int ans[6] = {a[1], a[2], b[1], b[2], b[3], a[3]};
				answer(ans);
			}
			else if (x == a[3])
			{
				int ans[6] = {a[1], a[2], b[1], b[2], a[3], b[3]};
				answer(ans);
			}
			else
			{
				int ans[6] = {a[1], a[2], b[1], a[3], b[2], b[3]};
				answer(ans);
			}
		}
	}
	else
	{
		if (getLightest(a[2], b[2], b[3]) == a[2])
		{
			int x = getMedian(b[2], b[3], a[3]);

			if (x == b[3])
			{
				int ans[6] = {a[1], b[1], a[2], b[2], b[3], a[3]};
				answer(ans);
			}
			else if (x == a[3])
			{
				int ans[6] = {a[1], b[1], a[2], b[2], a[3], b[3]};
				answer(ans);
			}
			else
			{
				int ans[6] = {a[1], b[1], a[2], a[3], b[2], b[3]};
				answer(ans);
			}
		}
		else
		{
			int x = getMedian(a[2], a[3], b[3]);

			if (x == a[2])
			{
				int ans[6] = {a[1], b[1], b[2], b[3], a[2], a[3]};
				answer(ans);
			}
			else if (x == b[3])
			{
				int ans[6] = {a[1], b[1], b[2], a[2], b[3], a[3]};
				answer(ans);
			}
			else
			{
				int ans[6] = {a[1], b[1], b[2], a[2], a[3], b[3]};
				answer(ans);
			}
		}
	}
}

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

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