# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
707837 | abcvuitunggio | Scales (IOI15_scales) | C++17 | 1 ms | 296 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) {
/* ... */
}
void orderCoins() {
/* ... */
int W[] = {1, 2, 3, 4, 5, 6};
vector <int> A,B,C;
A.push_back(getLightest(1,2,3));
A.push_back(getMedian(1,2,3));
A.push_back(6-A[0]-A[1]);
B.push_back(getLightest(4,5,6));
B.push_back(getMedian(4,5,6));
B.push_back(15-B[0]-B[1]);
int i=0,j=0;
while (i<3&&j<3){
if (i==2&&j==2){
int x=getHeaviest(A[i-1],A[i],B[j]);
if (x==A[i]){
C.push_back(B[j]);
j++;
}
else{
C.push_back(A[i]);
i++;
}
continue;
}
int x=0;
if (i<2)
x=getLightest(A[i],A[i+1],B[j]);
else
x=getLightest(A[i],B[j],B[j+1]);
C.push_back(x);
if (x==A[i])
i++;
else
j++;
}
for (;i<3;i++)
C.push_back(A[i]);
for (;j<3;j++)
C.push_back(B[j]);
for (int i=0;i<6;i++)
W[i]=C[i];
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |