Submission #782790

#TimeUsernameProblemLanguageResultExecution timeMemory
782790ymmScales (IOI15_scales)C++17
45.45 / 100
1 ms212 KiB
#include "scales.h"
#include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (l); --x)
typedef std::pair<int,int> pii;
typedef long long ll;
using namespace std;

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

void lstmx(int &a, int &b, int &c)
{
	int x = getHeaviest(a, b, c);
	if (a == x)
		swap(a, c);
	if (b == x)
		swap(b, c);
}

void orderCoins() {
    /* ... */
    int W[] = {1, 2, 3, 4, 5, 6};
    {
	    lstmx(W[0], W[1], W[2]);
	    lstmx(W[2], W[3], W[4]);
	    lstmx(W[0], W[4], W[5]);
    }
    {
	    lstmx(W[0], W[1], W[2]);
	    lstmx(W[2], W[3], W[4]);
    }
    {
	    lstmx(W[0], W[1], W[2]);
	    lstmx(W[0], W[2], W[3]);
    }
    {
	    lstmx(W[0], W[1], W[2]);
    }
    {
	    int x = getLightest(W[0], W[1], W[2]);
	    if (x == W[1])
		    swap(W[0], W[1]);
    }
    answer(W);
}

Compilation message (stderr)

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