# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
580414 | alireza_kaviani | Scales (IOI15_scales) | C++17 | 1 ms | 340 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>
void init(int T) {
}
void Sort3(int &A , int &B , int &C){
int x = A , y = B , z = C;
int res = getMedian(x , y , z);
if(res == x){
A = z; B = x; C = y;
}
if(res == y){
A = x; B = y; C = z;
}
if(res == z){
A = x; B = z; C = y;
}
}
void orderCoins() {
int ax = getLightest(1 , 2 , 3);
int az = getHeaviest(1 , 2 , 3);
int ay = 1 + 2 + 3 - ax - az;
int bx = getLightest(4 , 5 , 6);
int bz = getHeaviest(4 , 5 , 6);
int by = 4 + 5 + 6 - bx - bz;
int W[6] = {ax , ay , bx , by , bz , az};
Sort3(W[0] , W[1] , W[2]);
Sort3(W[3] , W[4] , W[5]);
Sort3(W[1] , W[2] , W[3]);
Sort3(W[2] , W[3] , W[4]);
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |