# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
741800 | Trunkty | Scales (IOI15_scales) | C++14 | 1 ms | 308 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>
using namespace std;
typedef long long ll;
//#define int ll
#include "scales.h"
void init(int t){}
int ans[6];
void orderCoins(){
int a1,a2,a3,b1,b2,b3;
a1 = getLightest(1,2,3);
a3 = getHeaviest(1,2,3);
a2 = 6-a1-a3;
b1 = getLightest(4,5,6);
b3 = getHeaviest(4,5,6);
b2 = 15-b1-b3;
int x = getNextLightest(a1,a2,a3,b1);
if(x==a1){
x = getHeaviest(a1,a2,b1);
if(x==a2){
x = a1;
}
}
int y = getNextLightest(a1,a2,a3,b2);
if(y==a1){
y = getHeaviest(a1,a2,b2);
if(y==a2){
y = a1;
}
}
int z = getNextLightest(a1,a2,a3,b3);
if(z==a1){
z = getHeaviest(a1,a2,b3);
if(z==a2){
z = a1;
}
}
vector<int> v;
if(x==a1){
v.push_back(b1);
}
if(y==a1){
v.push_back(b2);
}
if(z==a1){
v.push_back(b3);
}
v.push_back(a1);
if(x==a2){
v.push_back(b1);
}
if(y==a2){
v.push_back(b2);
}
if(z==a2){
v.push_back(b3);
}
v.push_back(a2);
if(x==a3){
v.push_back(b1);
}
if(y==a3){
v.push_back(b2);
}
if(z==a3){
v.push_back(b3);
}
v.push_back(a3);
if(x==b1){
v.push_back(b1);
}
if(y==b2){
v.push_back(b2);
}
if(z==b3){
v.push_back(b3);
}
for(int i=0;i<v.size();i++){
ans[i] = v[i];
}
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |