# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1034271 | vjudge1 | Scales (IOI15_scales) | C++17 | 1 ms | 432 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) {
/* ... */
}
void orderCoins() {
int ans[6];
int min1=getLightest(1,2,3);
int min2=getLightest(4,5,6);
ans[0]=getLightest(min1,min2,min1==1?2:1);
ans[1]=ans[0]==min1?min2:min1;
vector<int>toask;
int didntask=-1;
for(int i=1;i<=6;i++){
if(i==ans[0]||i==ans[1])continue;
if(toask.size()<3)toask.push_back(i);
else didntask=i;
}
int min3=getLightest(toask[0],toask[1],toask[2]);
int min4=getLightest(min3,didntask,toask[0]==min3?toask[1]:toask[0]);
ans[2]=min4;
if(min4==min3){
toask.clear();
for(int i=1;i<=6;i++){
for(int j=0;j<3;j++)if(ans[j]==i)goto nuhuh;
toask.push_back(i);
nuhuh:;
}
min3=getLightest(toask[0],toask[1],toask[2]);
}
ans[3]=min3;
toask.clear();
for(int i=1;i<=6;i++){
for(int j=0;j<4;j++)if(ans[j]==i)goto nuhuh1;
toask.push_back(i);
nuhuh1:;
}
int maxi=getHeaviest(toask[0],toask[1],ans[0]);
ans[5]=maxi;
ans[4]=maxi==toask[0]?toask[1]:toask[0];
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |