# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
39900 | mohammad_kilani | Scales (IOI15_scales) | C++14 | 0 ms | 2024 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;
void init(int T) {
}
vector <int> get(int a,int b,int c){
int cur1 = getLightest(a,b,c);
int cur2 = getMedian(a,b,c);
int cur3;
if(a != cur1 && a != cur2) cur3 = a;
if(b != cur1 && b != cur2) cur3 = b;
if(c != cur1 && c != cur2) cur3 = c;
vector<int> v;
v.push_back(cur1);
v.push_back(cur2);
v.push_back(cur3);
return v;
}
void orderCoins() {
int val[7];
vector< int > v[2];
v[0] = get(1,2,3);
v[1] = get(4,5,6);
int idx = 0;
int idx1 = 0 , idx2 = 0;
int w[6];
while(idx < 3){
int a = getLightest(v[0][idx1],v[1][idx2],(idx1 == 2 ? v[1][idx2 + 1] : v[0][idx1 + 1]));
w[idx++] = a;
if(a == v[0][idx1])
idx1++;
else
idx2++;
}
vector<int> tmp;
while(idx1 < v[0].size()) tmp.push_back(v[0][idx1++]);
while(idx2 < v[1].size()) tmp.push_back(v[1][idx2++]);
tmp = get(tmp[0],tmp[1],tmp[2]);
for(int i=0;i<tmp.size();i++) w[idx++] = tmp[i];
answer(w);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |