# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432226 | jeqcho | Scales (IOI15_scales) | C++17 | 1 ms | 256 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;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define F0R(i,b) FOR(i,0,b)
#define ROF(i,a,b) for(int i=b-1;i>=a;--i)
#define R0F(i,b) ROF(i,0,b)
#define trav(a,x) for(auto&a:x)
#define all(x) begin(x),end(x)
#define fi first
#define se second
#define pb push_back
#define sz(x) int(x.size())
void init(int T) {
/* ... */
}
void orderCoins() {
vi known;
int mx = getHeaviest(1,2,3);
int mn = getLightest(1,2,3);
known.pb(mn);
FOR(i,1,3+1)
{
if(i!=mx&&i!=mn)known.pb(i);
}
known.pb(mx);
FOR(i,4,6+1)
{
ROF(t,1,sz(known))
{
int md = getMedian(known[t-1],known[t],i);
if(known[t]==md)
{
known.insert(known.end(),i);
break;
}
else if(i==md)
{
known.insert(known.begin()+t,i);
break;
}
else if(t-1==0)
{
known.insert(known.begin(),i);
break;
}
}
}
int W[6];
F0R(i,6)
{
W[i]=known[i];
}
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |