# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
793126 | PixelCat | Scales (IOI15_scales) | C++14 | 1 ms | 300 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.
#ifdef NYAOWO
#include "grader.cpp"
#endif
#include "scales.h"
#include <bits/stdc++.h>
#define For(i, a, b) for(int i = a; i <= b; i++)
#define Forr(i, a, b) for(int i = a; i >= b; i--)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
#define eb emplace_back
using namespace std;
using LL = long long;
using pii = pair<int, int>;
void init(int T) {
/* ... */
assert(T < 20);
}
void orderCoins() {
/* ... */
int W[] = {1, 2, 3, 4, 5, 6};
For(i, 2, 5) {
int mx = getHeaviest(W[0], W[1], W[i]);
if(W[0] == mx) swap(W[0], W[i]);
if(W[1] == mx) swap(W[1], W[i]);
}
For(i, 4, 5) {
int mx = getHeaviest(W[2], W[3], W[i]);
if(W[2] == mx) swap(W[2], W[i]);
if(W[3] == mx) swap(W[3], W[i]);
}
int x;
x = getLightest(W[0], W[1], W[2]);
if(W[1] == x) swap(W[0], W[1]);
x = getLightest(W[2], W[3], W[4]);
if(W[3] == x) swap(W[2], W[3]);
x = getHeaviest(W[3], W[4], W[5]);
if(W[4] == x) swap(W[4], W[5]);
answer(W);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |