# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
430940 | p_square | Scales (IOI15_scales) | C++14 | 1 ms | 204 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 getLightest(int a, int b, int c)
{
cout<<a<<b<<c;
int x;
cin>>x;
return x;
}
int getHeaviest(int a, int b, int c)
{
cout<<a<<b<<c<<"HEAVY";
int x;
cin>>x;
return x;
}
*/
void swap(int W[], int x, int y)
{
W[x] ^= W[y];
W[y] ^= W[x];
W[x] ^= W[y];
}
void init(int T) {
/* ... */
}
void orderCoins() {
/* ... */
int W[] = {1, 2, 3, 4, 5, 6};
int a;
a = getLightest(1, 2, 3);
if(a == W[1])
swap(W, 0, 1);
if(a == W[2])
swap(W, 0, 2);
a = getLightest(W[0], W[3], W[4]);
if(a == W[3])
swap(W, 0, 3);
if(a == W[4])
swap(W, 0, 4);
a = getLightest(W[0], W[2], W[5]);
if(a == W[5])
swap(W, 0, 5);
a = getLightest(W[1], W[2], W[3]);
if(a == W[2])
swap(W, 1, 2);
if(a == W[3])
swap(W, 1, 3);
a = getLightest(W[1], W[4], W[5]);
if(a == W[4])
swap(W, 1, 4);
if(a == W[5])
swap(W, 1, 5);
a = getLightest(W[2], W[3], W[4]);
if(a == W[3])
swap(W, 3, 2);
if(a == W[4])
swap(W, 4, 2);
a = getMedian(W[2], W[3], W[5]);
if(a == W[2])
{
swap(W, 5, 2);
swap(W, 3, 5);
}
if(a == W[5])
{
swap(W, 5, 3);
}
a = getMedian(W[3], W[4], W[5]);
if(a == W[3])
swap(W, 4, 3);
if(a == W[5])
swap(W, 4, 5);
answer(W);
}
/*
int main()
{
orderCoins();
}
*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |