# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
783758 | Lyrically | Scales (IOI15_scales) | C++17 | 1 ms | 212 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 init(int t){/*QwQ*/}
int QwQ_QwQ(int a,int b,int c,int d){
int x[3];
x[0]=a;
x[1]=b;
x[2]=c;
sort(x,x+3);
if(d<x[0]) return x[0];
if(d<x[1]) return x[1];
if(d<x[2]) return x[2];
return x[0];
}
void orderCoins(){
int a[6],q[6],qq=0;
q[0]=getNextLightest(1,2,3,4);
q[1]=getNextLightest(2,3,4,5);
q[2]=getNextLightest(3,4,5,6);
q[3]=getNextLightest(4,5,6,1);
q[4]=getNextLightest(5,6,1,2);
q[5]=getNextLightest(6,1,2,3);
for(int i=0;i<6;++i) qq=qq<<4|q[i];
iota(a,a+6,1);
do{
int now=0;
for(int i=0;i<6;++i) now=now<<4|QwQ_QwQ(a[i],a[(i+1)%6],a[(i+2)%6],a[(i+3)%6]);
if(now==qq){
answer(a);
return;
}
}while(next_permutation(a,a+6));
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |