# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97494 | wilwxk | Scales (IOI15_scales) | C++11 | 4 ms | 512 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;
void init(int t) {
mt19937 rng(time(0)+t);
}
void orderCoins() {
int respf[]={1, 2, 3, 4, 5, 6};
vector<int> resp;
int v[]={0, 1, 2, 3, 4, 5, 6};
random_shuffle(v+1, v+7);
int a, b;
a=getLightest(v[1], v[2], v[3]);
if(v[2]==a) swap(v[1], v[2]);
if(v[3]==a) swap(v[1], v[3]);
a=getMedian(v[1], v[2], v[3]);
if(v[3]==a) swap(v[2], v[3]);
a=getLightest(v[4], v[5], v[6]);
if(v[5]==a) swap(v[4], v[5]);
if(v[6]==a) swap(v[4], v[6]);
a=getMedian(v[4], v[5], v[6]);
if(v[6]==a) swap(v[5], v[6]);
int p=1;
for(int i=4; i<=6; i++) {
int cara=getNextLightest(v[1], v[2], v[3], v[i]);
while(v[p]!=cara) resp.push_back(v[p++]);
resp.push_back(v[i]);
}
while(p!=4) resp.push_back(v[p++]);
for(int i=0; i<6; i++) respf[i]=resp[i];
answer(respf);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |