kaffan
December 11, 2020, 10:38am
1
You are not taking N as input and you had purely dearranged the no.s , just see his code , It clearly shows which no. Is first and which is last , order of no. Matter in this question
kaffan
December 11, 2020, 11:21am
3
Thanks for your reply
can you please tell me why does order matter in this question?
and can you explain
when kk=6
else if(kk==6)
{
cout<<“1 1 2 4”<<endl;
cin>>a;
cout<<“1 2 3 5”<<endl;
cin>>b;
cout<<“1 3 4 6”<<endl;
cin>>c;
cout<<“1 4 5 1”<<endl;
cin>>d;
cout<<“1 5 6 2”<<endl;
cin>>e;
cout<<“1 6 1 3”<<endl;
cin>>f;
aa[1]=e^f^b;
aa[2]=f^a^c;
aa[3]=a^b^d;
aa[4]=b^c^e;
aa[5]=c^d^f;
aa[6]=d^e^a;
}
but when kk==7 in his solution, to one which i have reffered it is
else if(kk==7)
{
cout<<“1 1 2 3”<<endl;
cin>>a;
cout<<“1 4 5 6”<<endl;
cin>>b;
cout<<“1 7 1 2”<<endl;
cin>>c;
cout<<“1 3 4 5”<<endl;
cin>>d;
cout<<“1 6 7 1”<<endl;
cin>>e;
cout<<“1 2 3 4”<<endl;
cin>>f;
cout<<“1 5 6 7”<<endl;
cin>>g;
aa[1]=a^b^c^d^e;
aa[2]=f^g^a^b^c;
aa[3]=d^e^f^g^a;
aa[4]=b^c^d^e^f;
aa[5]=g^a^b^c^d;
aa[6]=e^f^g^a^b;
aa[7]=c^d^e^f^g;
}
Order matters because you have to find all elements of the sequence , and in a sequence the sequence of no.s matters .