# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
286293 | AaronNaidu | Scales (IOI15_scales) | C++14 | 1 ms | 384 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;
int t;
void init(int T) {
t = T;
}
/*int getLightest(int a, int b, int c) {
cout << "Lightest of " << a << " " << b << " " << c << "\n";
int ans;
cin >> ans;
return ans;
}
int getMedian(int a, int b, int c) {
cout << "Median of " << a << " " << b << " " << c << "\n";
int ans;
cin >> ans;
return ans;
}
void answer(vector<int> v) {
cout << "Answer:\n";
for (auto i : v)
{
cout << i << " ";
}
}*/
void orderCoins() {
int answerVector[6];
int lightest1 = getLightest(1, 2, 3);
lightest1 = getLightest(lightest1, 4, 5);
if (lightest1 == 5)
{
lightest1 = getLightest(lightest1, 4, 6);
}
else
{
lightest1 = getLightest(lightest1, 5, 6);
}
answerVector[0] = (lightest1);
vector<int> origVector;
for (int i = 1; i < 7; i++)
{
if (i != lightest1)
{
origVector.push_back(i);
}
}
lightest1 = getLightest(origVector[0], origVector[1], origVector[2]);
lightest1 = getLightest(lightest1, origVector[3], origVector[4]);
answerVector[1] = (lightest1);
vector<int> newOrigVector;
for (int i = 0; i < 5; i++)
{
if (origVector[i] != lightest1)
{
newOrigVector.push_back(origVector[i]);
}
}
origVector = newOrigVector;
newOrigVector.clear();
lightest1 = getLightest(origVector[0], origVector[1], origVector[2]);
if (lightest1 == origVector[0])
{
lightest1 = getLightest(lightest1, origVector[1], origVector[3]);
}
else
{
lightest1 = getLightest(lightest1, origVector[0], origVector[3]);
}
answerVector[2] = (lightest1);
for (int i = 0; i < 4; i++)
{
if (origVector[i] != lightest1)
{
newOrigVector.push_back(origVector[i]);
}
}
lightest1 = getLightest(newOrigVector[0], newOrigVector[1], newOrigVector[2]);
answerVector[3] = (lightest1);
int med1 = getMedian(newOrigVector[0], newOrigVector[1], newOrigVector[2]);
answerVector[4] = (med1);
for (int i = 0; i < 3; i++)
{
if (newOrigVector[i] != lightest1 and newOrigVector[i] != med1)
{
answerVector[5] = (newOrigVector[i]);
}
}
answer(answerVector);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |