# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
285864 | Ozy | Scales (IOI15_scales) | C++17 | 1 ms | 384 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 rep(i,a,b) for (int i = (a); i <= (b); i++)
int W[6];
void init(int T) {
/* ... */
}
void orderCoins() {
/* ... */
int a,b,c,c1,cont;
int arr[4];
a = getLightest(1,2,3);
b = getLightest(4,5,6);
c = a+1;
if (c == b) c++;
W[0] = getLightest(a,b,c);
if (W[0] == a) {
c = 1;
if (c == a) c++;
c1 = c+1;
if (c1 == a) c1++;
W[1] = getLightest(b,c,c1);
}
else {
c = 4;
if (c == b) c++;
c1 = c+1;
if (c1 == b) c1++;
W[1] = getLightest(a,c,c1);
}
cont = 1;
rep(i,0,3) {
arr[i] = cont;
cont++;
while (arr[i] == W[0] || arr[i] == W[1]) {
arr[i] = cont;
cont++;
}
}
a = getLightest(arr[0],arr[1],arr[2]);
b = arr[0];
if (b == a) b = arr[1];
W[2] = getLightest(a,b,arr[3]);
cont = 0;
a = arr[cont++];
if (arr[cont-1] == W[2]) a = arr[cont++];
b = arr[cont++];
if (arr[cont-1] == W[2]) b = arr[cont++];
c = arr[cont++];
if (arr[cont-1] == W[2]) c = arr[cont++];
W[3] = getLightest(a,b,c);
W[5] = getHeaviest(a,b,c);
if (a != W[3] && a != W[5]) W[4] = a;
else if (b != W[3] && b != W[5]) W[4] = b;
else W[4] = c;
answer(W);
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |