# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
961406 | 12345678 | Scales (IOI15_scales) | C++17 | 1 ms | 440 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 res[6], mn;
vector<int> v;
void getmin()
{
vector<int> v2;
if (v.size()==3)
{
res[3]=getLightest(v[0], v[1], v[2]);
for (int i=0; i<v.size(); i++) if (v[i]!=res[3]) v2.push_back(v[i]);
v=v2;
}
else if (v.size()==2)
{
res[4]=getMedian(v[0], v[1], res[0]);
for (int i=0; i<v.size(); i++) if (v[i]!=res[4]) v2.push_back(v[i]);
v=v2;
}
else if (v.size()==1)
{
res[5]=v[0];
}
else if (v.size()==6)
{
mn=getLightest(v[0], v[1], v[2]);
mn=getLightest(mn, v[3], v[4]);
mn=getLightest(mn, v[5], v[0+(mn==1)]);
res[0]=mn;
for (int i=0; i<v.size(); i++) if (v[i]!=mn) v2.push_back(v[i]);
v=v2;
}
else if (v.size()==5)
{
mn=getLightest(v[0], v[1], v[2]);
mn=getLightest(mn, v[3], v[4]);
res[1]=mn;
for (int i=0; i<v.size(); i++) if (v[i]!=mn) v2.push_back(v[i]);
v=v2;
}
else if (v.size()==4)
{
mn=getLightest(v[0], v[1], v[2]);
mn=getLightest(mn, v[3], v[0+(mn==v[0])]);
res[2]=mn;
for (int i=0; i<v.size(); i++) if (v[i]!=mn) v2.push_back(v[i]);
v=v2;
}
}
void orderCoins() {
v.clear();
for (int i=1; i<=6; i++) v.push_back(i);
for (int i=0; i<6; i++) getmin();
answer(res);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |