# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1098907 | alexander_707070 | Scales (IOI15_scales) | C++14 | 58 ms | 596 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<bits/stdc++.h>
#include "scales.h"
using namespace std;
vector<int> p;
vector< vector<int> > perms,news;
int getmin(vector<int> s,int a,int b,int c){
if(s[a]<s[b] and s[a]<s[c])return 0;
if(s[b]<s[c] and s[b]<s[a])return 1;
return 2;
}
int getmax(vector<int> s,int a,int b,int c){
if(s[a]>s[b] and s[a]>s[c])return 0;
if(s[b]>s[c] and s[b]>s[a])return 1;
return 2;
}
int getmed(vector<int> s,int a,int b,int c){
if(s[a]<max(s[b],s[c]) and s[a]>min(s[b],s[c]))return 0;
if(s[b]<max(s[a],s[c]) and s[b]>min(s[a],s[c]))return 1;
return 2;
}
int getbro(vector<int> s,int a,int b,int c,int d){
if(s[a]<s[d] and s[b]<s[d] and s[c]<s[d])return getmin(s,a,b,c);
if(s[a]>s[d] and (s[b]<s[d] or s[a]<s[b]) and (s[c]<s[d] or s[a]<s[c]))return 0;
if(s[b]>s[d] and (s[a]<s[d] or s[b]<s[a]) and (s[c]<s[d] or s[b]<s[c]))return 1;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |