# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
115418 | nvmdava | Scales (IOI15_scales) | C++17 | 14 ms | 768 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 depmax[] = {729, 243, 81, 27, 9, 3, 1};
struct Ord{
int a[7];
Ord(vector<int>& v){
for(int i = 0; i < 6; i++)
a[i + 1] = v[i];
}
};
struct Query{
int a, b, c, d;
Query(int _a, int _b, int _c, int _d){
a = _a;
b = _b;
c = _c;
d = _d;
}
int ask(){
int res;
if(d == a) res = getLightest(a, b, c);
else if(d == b) res = getMedian(a, b, c);
else if(d == c) res = getHeaviest(a, b, c);
else res = getNextLightest(a, b, c, d);
if(res == a) return 1;
if(res == b) return 2;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |