# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
485438 | AmirElarbi | Scales (IOI15_scales) | C++14 | 1 ms | 460 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"
#define vi vector<int>
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define fi first
#define se second
#define INF 1e9
#define eps 1e-7
#define eps1 1e-25
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 1e5+5
#define V 450
using namespace std;
const int MOD = 1e9+7;
const int nax = 200005;
void init(int T) {
return;
}
void orderCoins() {
int i = 1, j = 2, k = 3;
int light = getLightest(i,j,k), hev = getHeaviest(i,j,k);
light = getLightest(light,4,5), hev = getHeaviest(hev,4,5);
if(light!=4)
light = getLightest(light,4,6);
else
light = getLightest(light,5,6);
if(hev!=4)
hev = getHeaviest(hev,4,6);
else
hev = getHeaviest(hev,5,6);
int w[6];
w[0] = light;
bool a[6];
a[light-1] = 1;
vi s;
for(int i = 0; i < 6; i++){
if(!a[i]){s.pb(i+1);}
}
int res = getNextLightest(s[0],s[1],s[2],light);
w[1] = light = getLightest(res,s[3],s[4]);
a[light-1] = true;
s.clear();
for(int i = 0; i < 6; i++){
if(!a[i]){s.pb(i+1);}
}
res = getNextLightest(s[0],s[1],s[2],light);
w[2] = light = getMedian(res,s[3],w[1]);
a[light-1] = true;
s.clear();
for(int i = 0; i < 6; i++){
if(!a[i]){s.pb(i+1);}
}
w[3] = light = getNextLightest(s[0],s[1],s[2],light);
a[light-1] = true;
w[5] = hev;
for(int i = 0; i < 6; i++){
if(!a[i]){w[4] = i; break;}
}
answer(w);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |