# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
800721 | firewater | Scales (IOI15_scales) | C++14 | 1 ms | 468 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 <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
using namespace std;
// int getHeaviest(int A, int B, int C)
// int getMedian(int A, int B, int C)
// int getLightest(int A, int B, int C)
// int getNextLightest(int A, int B, int C, int D)
#define N 100
int w,x,y,a[N],p[N],sav,ans[6];
void init(int T) {
/* ... */
}
void orderCoins() {
/* ... */
for(int i=1;i<=6;++i)p[i]=0;
for(int i=0;i<=5;++i){
w=0;
for(int j=1;j<=6;++j)
if(!p[j])a[++w]=j;
sav=a[1];
for(int j=2;j<=w;++j)
sav=getMedian(ans[0],sav,a[j]);
ans[i]=sav;
p[sav]=1;
}
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |