# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
802619 | Liudas | Scales (IOI15_scales) | C++17 | 2 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 <bits/stdc++.h>
#include "scales.h"
using namespace std;
void orderCoins(){
int arr[6];
vector<int> b = {1,2,3,4,5,6};
int ans = getHeaviest(1,2,3);
int ans2 = getHeaviest(4, 5, 6);
int ans3 = getHeaviest(ans, ans2, (ans == 3? 2: 3));
arr[5] = ans3;
b.erase(find(b.begin(), b.end(), ans3));
if(ans == ans3){
b.erase(find(b.begin(), b.end(), ans2));
ans3 = getHeaviest(b[0], b[1], ans2);
b.push_back(ans2);
}
else{
b.erase(find(b.begin(), b.end(), ans));
ans3 = getHeaviest(b[2], b[3], ans);
b.push_back(ans);
}
b.erase(find(b.begin(), b.end(), ans3));
arr[4] = ans;
ans = getLightest(b[0],b[1],b[2]);
ans = getLightest(ans, b[3], arr[5]);
b.erase(find(b.begin(), b.end(), ans));
arr[0] = ans;
ans = getHeaviest(b[0],b[1],b[2]);
arr[3] = ans;
ans2 = getLightest(b[0],b[1],b[2]);
arr[1] = ans2;
b.erase(find(b.begin(), b.end(), ans));
b.erase(find(b.begin(), b.end(), ans2));
arr[2] = b[0];
answer(arr);
}
void init(int T){
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |