# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1077892 | mariza | Scales (IOI15_scales) | C++14 | 1 ms | 348 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;
typedef long long ll;
void init(int T) {
}
void orderCoins() {
set<ll> x;
for(ll i=1; i<=6; i++){
x.insert(i);
}
int ans[6];
ll z=0;
for(ll i=0; i<3; i++){
set<ll> y;
for(ll j=1; j<=6; j++){
if(x.find(j)!=x.end()) y.insert(j);
}
while(y.size()>1){
if(y.size()==2) y.insert(z);
ll a=*y.begin(); y.erase(a);
ll b=*y.begin(); y.erase(b);
ll c=*y.begin(); y.erase(c);
cout<<i<<" "<<y.size()<<" "<<z<<endl;
y.insert(getLightest(a,b,c));
if(a!=*y.begin()) z=a;
else z=b;
}
ans[i]=*y.begin();
x.erase(*y.begin());
}
ll a=*x.begin(); x.erase(a);
ll b=*x.begin(); x.erase(b);
ll c=*x.begin(); x.erase(c);
ans[3]=getLightest(a,b,c);
ans[4]=getMedian(a,b,c);
if(min(ans[3],ans[4])==b) ans[5]=a;
else if(max(ans[3],ans[4])==b) ans[5]=c;
else ans[5]=b;
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |