# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
118964 | oolimry | Scales (IOI15_scales) | C++14 | 3 ms | 512 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 orderCoins() {
/* ... */
int W[] = {1, 2, 3, 4, 5, 6};
W[0] = getLightest(1,2,3);
W[1] = getLightest(4,5,6);
int smth = 1;
if(W[0] == 1 || W[1] == 1) smth = 2;
if(W[0] == 2 || W[1] == 2) smth = 3;
if(getLightest(W[0],W[1],smth) == W[1]) swap(W[0],W[1]);
W[4] = getHeaviest(1,2,3);
W[5] = getHeaviest(4,5,6);
smth = W[0];
if(getHeaviest(W[4],W[5],smth) == W[1]) swap(W[4],W[5]);
set<int> s = {W[0],W[1],W[4],W[5]};
int a = -1, b = -1;
for(int i = 1;i <= 6;i++){
if(s.find(i) == s.end()){
if(a == -1) a = i;
else b = i;
}
}
W[2] = getLightest(a,b,W[5]);
if(W[2] == a) W[3] = b;
else W[3] = a;
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |