# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1078467 | ALeonidou | Scales (IOI15_scales) | C++17 | 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 "scales.h"
#include <bits/stdc++.h>
using namespace std;
#define ll int
#define sz(x) (ll)x.size()
#define F first
#define S second
#define pb push_back
typedef vector <ll> vi;
typedef pair <ll,ll> ii;
typedef vector <ii> vii;
#define dbg(x) cout<<#x<<": "<<x<<endl;
#define dbg2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl;
#define dbg3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<endl;
void printVct(vi &v){
for (ll i =0; i<sz(v); i++){
cout<<v[i]<<" ";
}
cout<<endl;
}
ll ttt = 0;
void init(int T) {
ttt = T;
return;
}
vi v;
ll v_s = 6;
void rem(ll idx){
for (ll i =0; i<sz(v); i++){
if (v[i] == idx){
v_s--;
swap(v[i], v[v_s]);
// printVct(v);
return;
}
}
}
void orderCoins() {
ll x = getLightest(1,getLightest(2,3,4),getLightest(4,5,6));
v = {1,2,3,4,5,6};
rem(x);
ll y = getLightest(v[0], v[1], getLightest(v[2], v[3], v[4]));
rem(y);
ll z = getLightest(v[0], v[1], getLightest(v[1], v[2], v[3]));
rem(z);
ll w = getLightest(v[0], v[1], v[2]);
rem(w);
ll t = getMedian(v[0], v[1], x);
rem(t);
ll e = v[0];
ll ans[6] = {x,y,z,w,t,e};
answer(ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |