# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
793532 | Markynoodle | 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<bits/stdc++.h>
using namespace std;
void init(int t){
return;
}
/*
int getLightest(int a, int b, int c){return 0;}
int getMedian(int a, int b, int c){return 0;}
int getHeaviest(int a, int b, int c){return 0;}
int getNextLightest(int a, int b, int c, int d){return 0;}
*/
void orderCoins(){
int one = getLightest(1, 2, 3);
int two = getMedian(1, 2, 3);
int three = 6 - one - two;
int four = getLightest(4, 5, 6);
int five = getMedian(4, 5, 6);
int six = 15 - four - five;
int ans[6] = {0,0,0,0,0,0};
int nextlight = getNextLightest(two, four, five, one);
if(nextlight == two){
ans[0] = one;
ans[1] = two;
int med = getMedian(three, five, six);
if(med == three){
ans[4] = three;
ans[5] = six;
ans[3] = five;
ans[2] = four;
}
if(med == five){
int medd = getMedian(three, four, five);
ans[2] = three;
ans[3] = four;
ans[4] = five;
ans[5] = six;
if(medd == three){
ans[2] = four;
ans[3] = three;
ans[4] = five;
ans[5] = six;
}
}
if(med == six){
ans[5] = three;
ans[4] = six;
ans[3] = five;
ans[2] = four;
}
}
if(nextlight == five){
ans[0] = four;
ans[1] = one;
ans[2] = five;
int med = getMedian(two, three, six);
if(med == two){
ans[3] = six;
ans[4] = two;
ans[5] = three;
}
if(med == three){
ans[3] = two;
ans[4] = three;
ans[5] = six;
}
if(med == six){
ans[3] = two;
ans[4] = six;
ans[5] = three;
}
}
if(nextlight == four){
ans[0] = one;
ans[1] = four;
int low = getLightest(two, three, five);
if(low == two){
ans[2] = two;
int med = getMedian(three, five, six);
if(med == three){
ans[3] = five;
ans[4] = three;
ans[5] = six;
}
if(med == five){
ans[3] = three;
ans[4] = five;
ans[5] = six;
}
if(med == six){
ans[3] = five;
ans[4] = six;
ans[5] = three;
}
}
if(low == five){
ans[2] = five;
int med = getMedian(two, three, six);
if(med == two){
ans[3] = six;
ans[4] = two;
ans[5] = three;
}
if(med == three){
ans[3] = two;
ans[4] = three;
ans[5] = six;
}
if(med == six){
ans[3] = two;
ans[4] = six;
ans[5] = three;
}
}
}
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |