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;
void init(int T) {return;}
void orderCoins() {
int a = getLightest(1, 2, 3);
int b = getMedian(1, 2, 3);
int c = 6 - a - b;
int d = getLightest(4, 5 ,6);
int e = getMedian(4, 5, 6);
int f = 15 - d - e;
// a b c / d e f
int k1 = getNextLightest(a, b, c, e);
if(k1 == b) {
// a e b c
int k2 = getNextLightest(e, b, c, f);
int k3 = getMedian(a, d, e);
if(k2==e) {
if(k3==a) {
answer({d,a,e,b,c,f});
return;
}
if(k3==d) {
answer({a,d,e,b,c,f});
return;
}
}
if(k2==b) {
if(k3==a) {
answer({d,a,e,f,b,c});
return;
}
if(k3==d) {
answer({a,d,e,f,b,c});
return;
}
}
if(k2==c) {
if(k3==a) {
answer({d,a,e,b,f,c});
return;
}
if(k3==d) {
answer({a,d,e,b,f,c});
return;
}
}
}
if(k1 == c) {
//a b e c
int k2 = getNextLightest(a, b, e, d);
int k3 = getMedian(e, c, f);
if(k2==a) {
if(k3==c) {
answer({d,a,b,e,c,f});
return;
}
if(k3==f) {
answer({d,a,b,e,f,c});
return;
}
}
if(k2==b) {
if(k3==c) {
answer({a,d,b,e,c,f});
return;
}
if(k3==f) {
answer({a,d,b,e,f,c});
return;
}
}
if(k2==e) {
if(k3==c) {
answer({a,b,d,e,c,f});
return;
}
if(k3==f) {
answer({a,b,d,e,f,c});
return;
}
}
}
// e a b c or a b c e
int k2 = getNextLightest(a,b,c,d);
if(k2==b) {
answer({a,d,b,c,e,f});
return;
}
if(k2==c) {
answer({a,b,d,c,e,f});
return;
}
if(k2==a) {
int k3 = getNextLightest(a,b,c,f);
if(k3==b) {
answer({d,e,a,f,b,c});
return;
}
if(k3==c) {
answer({d,e,a,b,f,c});
return;
}
if(k3==a) {
int k4 = getMedian(b, c, d);
assert(k4 != d);
if(k4==b) {
answer({d,e,f,a,b,c});
return;
}
if(k4==c) {
answer({a,b,c,d,e,f});
return;
}
}
}
}
Compilation message (stderr)
scales.cpp: In function 'void init(int)':
scales.cpp:4:15: warning: unused parameter 'T' [-Wunused-parameter]
4 | void init(int T) {return;}
| ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:20:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
20 | answer({d,a,e,b,c,f});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:24:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
24 | answer({a,d,e,b,c,f});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:30:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
30 | answer({d,a,e,f,b,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:34:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
34 | answer({a,d,e,f,b,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:40:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
40 | answer({d,a,e,b,f,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:44:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
44 | answer({a,d,e,b,f,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:55:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
55 | answer({d,a,b,e,c,f});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:59:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
59 | answer({d,a,b,e,f,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:65:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
65 | answer({a,d,b,e,c,f});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:69:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
69 | answer({a,d,b,e,f,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:75:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
75 | answer({a,b,d,e,c,f});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:79:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
79 | answer({a,b,d,e,f,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:87:29: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
87 | answer({a,d,b,c,e,f});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:91:29: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
91 | answer({a,b,d,c,e,f});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:97:33: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
97 | answer({d,e,a,f,b,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:101:33: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
101 | answer({d,e,a,b,f,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:108:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
108 | answer({d,e,f,a,b,c});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~
scales.cpp:112:37: error: cannot convert '<brace-enclosed initializer list>' to 'int*'
112 | answer({a,b,c,d,e,f});
| ^
| |
| <brace-enclosed initializer list>
In file included from scales.cpp:2:
scales.h:10:17: note: initializing argument 1 of 'void answer(int*)'
10 | void answer(int W[]);
| ~~~~^~~