# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
650195 | ojoConmigo | Scales (IOI15_scales) | C++17 | 1 ms | 304 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 <iostream>
using namespace std;
void init(int T) {
/* ... */
}
void orderCoins() {
/* ... */
int W[6];
int q = getLightest(1,2,3);
q = getLightest(q,4,5);
if(q != 5)q = getLightest(q,q+1,6);
else q = getLightest(q,q-1,6);
W[0] = q;
int k[3];
int t=0;
for(int i=1; i<=6; i++){
if(i != W[0]){
k[t++] = i;
}
if(t == 3){
q = getLightest(k[0],k[1],k[2]);
t = 1;
k[0] = q;
}
if(i == 6) W[1] = q;
}
t=0;
for(int i=1; i<=6; i++){
if(i != W[0] && i!=W[1]){
k[t++] = i;
}
if(t == 3){
q = getLightest(k[0],k[1],k[2]);
t = 2;
k[0] = q;
if(k[1] == q){
k[1] = k[2];
}
}
if(i == 6) W[2] = q;
}
t=0;
for(int i=1; i<=6; i++){
if(i != W[0] && i != W[1] && i != W[2]){
k[t++] = i;
}
}
W[3] = getLightest(k[0],k[1],k[2]);
W[4] = getMedian(k[0],k[1],k[2]);
for(int i=1; i<=6; i++){
bool b = true;
for(int j=0; j<5; j++){
if(i == W[j]){
b = false;
}
}
if(b){
W[5] = i;
break;
}
}
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |