# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
136999 | arthurconmy | Scales (IOI15_scales) | C++14 | 2 ms | 380 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;
#ifndef ARTHUR_LOCAL
#include "scales.h"
#endif
int t;
void init(int T)
{
t=T;
}
void orderCoins()
{
vector<int> cur = {1,2,3,4,5,6};
vector<int> ans;
for(int dot=1; dot<=4; dot++)
{
int cur_min = getLightest(cur[0],cur[1],cur[2]);
int not_min=-1;
if(cur_min==cur[0]) not_min=cur[1];
else not_min=cur[0];
if(dot<4)
{
int add_on = not_min;
if(dot<3) add_on=cur[4];
cur_min=getLightest(cur_min,cur[3],add_on);
}
if(dot==1)
{
cur_min = getLightest(cur_min,not_min,cur[5]);
}
ans.push_back(cur_min);
vector<int> new_cur;
for(auto c:cur)
{
if(c!=cur_min) new_cur.push_back(c);
}
cur=new_cur;
}
ans.push_back(getMedian(ans.back(),cur[0],cur[1]));
ans.push_back(cur[0]+cur[1]-ans.back());
// for(auto a:ans) cout << a << " ";
int A[6];
for(int i=0; i<6; i++) A[i]=ans[i];
answer(A);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |