#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
void init(int T) {}
void orderCoins() {
int w[6] = {-1, -1, -1, -1, -1, -1};
deque<int> f = { getLightest(1, 2, 3), 0, getHeaviest(1, 2, 3) };
f[1] = f[0] ^ f[2];
deque<int> s = { getLightest(4, 5, 6), 0, getHeaviest(4, 5, 6) };
s[1] = (3 + ((s[0] - 3) ^ (s[2] - 3)));
w[0] = getLightest(s[0], f[0], s[1]);
w[5] = getHeaviest(s[2], f[2], f[1]);
if(w[0] == f[0]) f.pop_front();
if(w[0] == s[0]) s.pop_front();
if(w[5] == f[2]) f.pop_back();
if(w[5] == s[2]) s.pop_back();
if(f.size() == s.size()) {
w[1] = getLightest(f[0], f[1], s[0]);
if(w[1] == f[0]) {
int x = getMedian(f[1], s[0], s[1]);
if(x == f[1]) {
w[2] = s[0], w[3] = f[1], w[4] = s[1];
} else if (x == s[0]) {
w[2] = f[1], w[3] = s[0], w[4] = s[1];
} else {
w[2] = s[0], w[3] = s[1], w[4] = f[1];
}
} else {
int x = getMedian(f[0], f[1], s[1]);
if(x == f[0]){
w[2] = s[1], w[3] = f[0], w[4] = f[1];
} else if(x == f[1]) {
w[2] = f[0], w[3] = f[1], w[4] = s[1];
} else {
w[2] = f[0], w[3] = s[1] , w[4] = f[1];
}
}
} else {
if(f.size() < s.size()) {
int x = getMedian(f[0], s[0], s[2]);
cout << x << endl;
if(x == s[0]) {
w[1] = f[0], w[2] = s[0], w[3] = s[1], w[4] = s[2];
} else if(x == s[2]) {
w[1] = s[0], w[2] = s[1], w[3] = s[2], w[4] = f[0];
} else {
w[1] = s[0], w[4] = s[2];
w[3] = getHeaviest(f[0], s[0], s[1]);
w[2] = w[3] ^ f[0] ^ s[1];
}
} else {
int x = getMedian(f[0], f[2], s[0]);
if(x == f[0]) {
w[1] = s[0], w[2] = f[0], w[3] = f[1], w[4] = f[3];
} else if(x == f[1]) {
w[1] = f[0], w[2] = f[1], w[3] = f[2], w[4] = s[0];
} else {
w[1] = f[0], w[4] = f[2];
w[3] = getHeaviest(f[0], f[1], s[0]);
w[2] = w[3] ^ f[1] ^ s[0];
}
}
}
answer(w);
}
Compilation message
In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (_ghksjhdfkae19ga_ > 1)
^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
for (i = 0; i < 6; i++) {
^~~
scales.cpp: In function 'void init(int)':
scales.cpp:5:15: warning: unused parameter 'T' [-Wunused-parameter]
void init(int T) {}
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Hacked. |
2 |
Incorrect |
2 ms |
484 KB |
Hacked. |
3 |
Incorrect |
2 ms |
596 KB |
Hacked. |
4 |
Incorrect |
2 ms |
708 KB |
Hacked. |
5 |
Incorrect |
2 ms |
708 KB |
Hacked. |
6 |
Incorrect |
2 ms |
708 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
736 KB |
Hacked. |
8 |
Incorrect |
2 ms |
756 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
880 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
880 KB |
Output isn't correct |
11 |
Incorrect |
2 ms |
880 KB |
Output isn't correct |
12 |
Incorrect |
2 ms |
880 KB |
Hacked. |
13 |
Incorrect |
2 ms |
880 KB |
Output isn't correct |
14 |
Incorrect |
2 ms |
880 KB |
Hacked. |
15 |
Incorrect |
2 ms |
880 KB |
Output isn't correct |
16 |
Incorrect |
2 ms |
880 KB |
Output isn't correct |
17 |
Incorrect |
2 ms |
880 KB |
Hacked. |
18 |
Incorrect |
2 ms |
880 KB |
Hacked. |
19 |
Incorrect |
2 ms |
880 KB |
Hacked. |
20 |
Incorrect |
2 ms |
880 KB |
Output isn't correct |
21 |
Incorrect |
2 ms |
884 KB |
Output isn't correct |
22 |
Incorrect |
2 ms |
884 KB |
Hacked. |
23 |
Incorrect |
2 ms |
892 KB |
Hacked. |
24 |
Incorrect |
2 ms |
892 KB |
Hacked. |
25 |
Incorrect |
2 ms |
892 KB |
Hacked. |
26 |
Incorrect |
2 ms |
892 KB |
Output isn't correct |
27 |
Incorrect |
2 ms |
892 KB |
Output isn't correct |
28 |
Incorrect |
2 ms |
892 KB |
Output isn't correct |
29 |
Incorrect |
2 ms |
924 KB |
Output isn't correct |
30 |
Incorrect |
2 ms |
928 KB |
Hacked. |
31 |
Incorrect |
2 ms |
936 KB |
Hacked. |
32 |
Incorrect |
2 ms |
936 KB |
Hacked. |
33 |
Incorrect |
2 ms |
940 KB |
Hacked. |
34 |
Incorrect |
2 ms |
944 KB |
Hacked. |
35 |
Incorrect |
2 ms |
948 KB |
Output isn't correct |
36 |
Incorrect |
2 ms |
1080 KB |
Hacked. |
37 |
Incorrect |
2 ms |
1080 KB |
Hacked. |
38 |
Incorrect |
2 ms |
1080 KB |
Hacked. |
39 |
Incorrect |
2 ms |
1080 KB |
Hacked. |
40 |
Incorrect |
2 ms |
1080 KB |
Hacked. |