# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
589978 | yutabi | Scales (IOI15_scales) | C++14 | 1 ms | 308 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
void init(int T)
{
/* ... */
}
void aaa(int W[], int b)
{
int res=getLightest(W[b],W[b-1],W[b-2]);
if(W[b]==res)
{
swap(W[b],W[b-1]);
}
if(W[b-1]==res)
{
swap(W[b-2],W[b-1]);
}
}
void orderCoins()
{
int W[] = {1, 2, 3, 4, 6, 5};
aaa(W,5);
aaa(W,3);
aaa(W,2);
aaa(W,5);
aaa(W,3);
aaa(W,5);
aaa(W,4);
aaa(W,5);
if(getHeaviest(W[4],W[5],W[0])!=W[5])
{
swap(W[4],W[5]);
}
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |