# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
45773 | jun6873 | Scales (IOI15_scales) | C++11 | 109 ms | 1512 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;
int p[720][7] = {{0, 1, 2, 3, 4, 5, 6}};
struct query {
query() {}
query(int t, int a, int b, int c, int d) : t(t), a(a), b(b), c(c), d(d) {}
int t, a, b, c, d;
int moi(int k) {
if (t==1) { // Heaviest
if (p[k][a] > p[k][b] and p[k][a] > p[k][c]) return 0;
else return (p[k][b] > p[k][c]) ? 1 : 2;
} if (t==2) { // Lightest
if (p[k][a] < p[k][b] and p[k][a] < p[k][c]) return 0;
else return (p[k][b] < p[k][c]) ? 1 : 2;
} if (t==3) { // Median
if (p[k][a] < p[k][b]) {
if (p[k][b] < p[k][c]) return 1;
else return p[k][a] < p[k][c] ? 2 : 0;
} else {
if (p[k][a] < p[k][c]) return 0;
else return p[k][b] < p[k][c] ? 2 : 1;
}
} if (t==4) { // NextHeaviest
int x = p[k][a], y = p[k][b], z = p[k][c];
if (not (x < p[k][d] and y < p[k][d] and z < p[k][d])) {
if (x < p[k][d]) x = 7;
if (y < p[k][d]) y = 7;
if (z < p[k][d]) z = 7;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |