#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pb push_back
void init(int T) {
/* ... */
}
int A(int a,int b,int c)
{
return getLightest(a,b,c);
}
int B(int a,int b,int c)
{
return getMedian(a,b,c);
}
int C(int a,int b,int c)
{
return getHeaviest(a,b,c);
}
int D(int a,int b,int c,int d)
{
return getNextLightest(a,b,c,d);
}
int min(int a,int b,int c)
{
return min(min(a,b),c);
}
int max(int a,int b,int c)
{
return max(max(a,b),c);
}
int med(int a,int b,int c)
{
return a+b+c-min(a,b,c)-max(a,b,c);
}
int nex(int a,int b,int c,int d)
{
int u[]={a,b,c,d};
sort(u,u+4);
for (int i=0;i<4;++i) if (u[i]==d) return u[(i+1)%4];
}
void orderCoins() {
/*int a=A(1,2,3),b=B(1,2,3),c=6-a-b;
int d=A(4,5,6),e=B(4,5,6),f=15-d-e;*/
//int a=A(1,2,3),d=A(4,5,6),p=A(2,4,6),q;
//int b=a==1?2:1,c=6-a-b,e=d==4?5:4,f=15-d-e;
//int g=D(a,b,c,d),h=D(a,b,c,e),k=A(c,d,a),m=A(a,f,c),n=D(a,b,c,f),o=A(a,e,c);
//cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<' '<<f<<' '<<g<<' '<<h<<' '<<k<<endl;
int com[9][4]={{5,4,2,3},{4,6,2,1},{2,3,4,1},{3,1,5,6},{1,2,6,5},{2,6,5,4},{3,2,4,5},{4,1,2,6},{4,5,6,1}};
vi res;
for (int i=0;i<6;++i) res.pb(D(com[i][0],com[i][1],com[i][2],com[i][3]));
res.pb(A(com[6][0],com[6][1],com[6][2]));
res.pb(B(com[7][0],com[7][1],com[7][2]));
res.pb(C(com[8][0],com[8][1],com[8][2]));
int z[]={1,2,3,4,5,6};
do
{
bool pos=1;
int la=-1;
//if (min(z[0],z[1],z[2])!=z[a-1]) pos=0,la=0;
//if (min(z[1],z[3],z[5])!=z[p-1]) pos=0,la=1;
//if (max(z[0],z[1],z[2])!=z[c-1]) pos=0,la=1;
//if (min(z[3],z[4],z[5])!=z[d-1]) pos=0,la=2;
//if (max(z[3],z[4],z[5])!=z[f-1]) pos=0,la=3;
/*if (nex(z[a-1],z[b-1],z[c-1],z[d-1])!=z[g-1]) pos=0,la=4;
if (nex(z[a-1],z[b-1],z[c-1],z[e-1])!=z[h-1]) pos=0,la=5;
if (min(z[c-1],z[d-1],z[a-1])!=z[k-1]) pos=0,la=6;
if (min(z[f-1],z[c-1],z[a-1])!=z[m-1]) pos=0,la=7;
if (nex(z[a-1],z[b-1],z[c-1],z[f-1])!=z[n-1]) pos=0,la=8;
if (min(z[a-1],z[e-1],z[c-1])!=z[o-1]) pos=0,la=9;*/
for (int i=0;i<6;++i) if (nex(z[com[i][0]-1],z[com[i][1]-1],z[com[i][2]-1],z[com[i][3]-1])!=z[res[i]-1]) pos=0,la=i;
if (min(z[com[6][0]-1],z[com[6][1]-1],z[com[6][2]-1])!=z[res[6]-1]) pos=0,la=6;
if (med(z[com[7][0]-1],z[com[7][1]-1],z[com[7][2]-1])!=z[res[7]-1]) pos=0,la=7;
if (max(z[com[8][0]-1],z[com[8][1]-1],z[com[8][2]-1])!=z[res[8]-1]) pos=0,la=8;
vi x(z,z+6);
int uu[]={5,4,1,2,6,3};
vi y(uu,uu+6);
/*if (x==y)
{
cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<' '<<f<<' '<<g<<' '<<h<<' '<<k<<endl;
cout<<nex(z[a-1],z[b-1],z[c-1],z[d-1])<<endl;
cout<<nex(z[a-1],z[b-1],z[c-1],z[e-1])<<endl;
cout<<la<<endl;
}*/
if (pos)
{
int u[]={0,0,0,0,0,0};
for (int i=0;i<6;++i) u[z[i]-1]=i+1;
for (int i=0;i<6;++i) cout<<u[i]<<' ';
cout<<endl;
answer(u);
}
}
while (next_permutation(z,z+6));
}
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:7:15: warning: unused parameter 'T' [-Wunused-parameter]
void init(int T) {
^
scales.cpp: In function 'void orderCoins()':
scales.cpp:70:10: warning: variable 'la' set but not used [-Wunused-but-set-variable]
int la=-1;
^~
scales.cpp: In function 'int nex(int, int, int, int)':
scales.cpp:51:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Hacked. |
2 |
Incorrect |
5 ms |
384 KB |
Hacked. |
3 |
Incorrect |
6 ms |
384 KB |
Hacked. |
4 |
Incorrect |
6 ms |
256 KB |
Hacked. |
5 |
Incorrect |
6 ms |
256 KB |
Hacked. |
6 |
Incorrect |
5 ms |
384 KB |
Hacked. |
7 |
Incorrect |
5 ms |
256 KB |
Hacked. |
8 |
Incorrect |
5 ms |
256 KB |
Hacked. |
9 |
Incorrect |
5 ms |
256 KB |
Hacked. |
10 |
Incorrect |
5 ms |
256 KB |
Hacked. |
11 |
Incorrect |
6 ms |
384 KB |
Hacked. |
12 |
Incorrect |
6 ms |
384 KB |
Hacked. |
13 |
Incorrect |
6 ms |
384 KB |
Hacked. |
14 |
Incorrect |
6 ms |
256 KB |
Hacked. |
15 |
Incorrect |
6 ms |
384 KB |
Hacked. |
16 |
Incorrect |
6 ms |
384 KB |
Hacked. |
17 |
Incorrect |
6 ms |
384 KB |
Hacked. |
18 |
Incorrect |
6 ms |
384 KB |
Hacked. |
19 |
Incorrect |
6 ms |
256 KB |
Hacked. |
20 |
Incorrect |
6 ms |
384 KB |
Hacked. |
21 |
Incorrect |
6 ms |
256 KB |
Hacked. |
22 |
Incorrect |
5 ms |
384 KB |
Hacked. |
23 |
Incorrect |
5 ms |
256 KB |
Hacked. |
24 |
Incorrect |
6 ms |
384 KB |
Hacked. |
25 |
Incorrect |
6 ms |
384 KB |
Hacked. |
26 |
Incorrect |
6 ms |
384 KB |
Hacked. |
27 |
Incorrect |
5 ms |
256 KB |
Hacked. |
28 |
Incorrect |
6 ms |
256 KB |
Hacked. |
29 |
Incorrect |
6 ms |
256 KB |
Hacked. |
30 |
Incorrect |
6 ms |
256 KB |
Hacked. |
31 |
Incorrect |
5 ms |
256 KB |
Hacked. |
32 |
Incorrect |
6 ms |
256 KB |
Hacked. |
33 |
Incorrect |
7 ms |
256 KB |
Hacked. |
34 |
Incorrect |
5 ms |
384 KB |
Hacked. |
35 |
Incorrect |
6 ms |
256 KB |
Hacked. |
36 |
Incorrect |
5 ms |
384 KB |
Hacked. |
37 |
Incorrect |
5 ms |
256 KB |
Hacked. |
38 |
Incorrect |
6 ms |
364 KB |
Hacked. |
39 |
Incorrect |
5 ms |
384 KB |
Hacked. |
40 |
Incorrect |
5 ms |
256 KB |
Hacked. |