# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
120187 | patrikpavic2 | Scales (IOI15_scales) | C++17 | 2 ms | 384 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 <vector>
#include <algorithm>
#define PB push_back
using namespace std;
void init(int T) {
}
void orderCoins() {
int A = getLightest(1, 2, 3);
int F = getHeaviest(4, 5, 6);
int B = 1 + (A <= 1), C = 2 + (A <= 2);
int D = 4 + (F <= 4), E = 5 + (F <= 5);
//printf("%d %d %d %d %d %d\n", A, B, C, D, E, F);
int AA = getLightest(A, D, E);
int FF = getHeaviest(F, B, C);
if(AA == D) swap(A, D);
if(AA == E) swap(A, E);
if(FF == B) swap(F, B);
if(FF == C) swap(F, C);
int BB = getLightest(B, C, D);
if(BB == C) swap(B, C);
if(BB == D) swap(B, D);
BB = getLightest(B, D, E);
if(BB == E) swap(B, E);
int EE = getHeaviest(C, D, E);
if(EE == C) swap(E, C);
if(EE == D) swap(E, D);
int CC = getLightest(C, D, E);
if(CC == D) swap(C, D);
int W[] = {A, B, C, D, E, F};
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |