# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
608701 | loctildore | Scales (IOI15_scales) | C++14 | 1 ms | 292 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;
// trans rights
#define ll long long
#define f first
#define s second
#define endl '\n'
#define all(x) begin(x), end(x)
void init(int T) {}
int a,b,c,tmp;
vector<int> v1,v2,v3,v4;
vector<int> v;
void srt(int &x, int &y, int &z) {
tmp=getLightest(x,y,z);
if (y==tmp) {
swap(x,y);
}
if (z==tmp) {
swap(x,z);
}
tmp=getMedian(x,y,z);
if (z==tmp) {
swap(y,z);
}
}
void orderCoins() {
a=2,b=3,c=5;
vector<int> v1,v2,v3,v4;
vector<int> v={1,4,6};
srt(a,b,c);
srt(v[0],v[1],v[2]);
bool flag=false;
for (auto i : v) {
if (!flag) {
tmp=getMedian(a,b,i);
if (tmp==a) {
v1.push_back(i);
}
if (tmp==i) {
v2.push_back(i);
}
if (tmp==b) {
flag=true;
}
}
if (flag) {
tmp=getMedian(b,c,i);
if (tmp==i) {
v3.push_back(i);
}
else {
v4.push_back(i);
}
}
}
vector<int> ans;
for (auto i:v1) ans.push_back(i);
ans.push_back(a);
for (auto i:v2) ans.push_back(i);
ans.push_back(b);
for (auto i:v3) ans.push_back(i);
ans.push_back(c);
for (auto i:v4) ans.push_back(i);
answer(&ans[0]);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |