You are not logged in. Please login at to post your questions!


please tell me the algorithm of H1 code.


Hi. I am new to codechef. I want to code the problem named " A puzzle game". It is the first problem in beginner level. But I cant understand how to approach. Please anyone give me a hint so that I can approach the problem.

asked 08 Jun, 21:55

sayan__1995's gravatar image

accept rate: 0%

Okay this problem is a little bit hard for beginners so don't worry if you don't understand I will give hints one by one read one by one and as soon as you get something that you have missed go back to the problem to solve it if even then you can't solve then read further hints

View Content
View Content
View Content
View Content
View Content
View Content

answered 09 Jun, 16:08

ssp547's gravatar image

accept rate: 25%

I wonder how did you save the step for each state. I stored states in a truct like this

 struct cube_t{
    int X11 , X12 , X13;
    int X21 , X22 , X23;
    int X31 , X32 , X33;

    bool operator ==(const cube_t& cb) const {}
    bool operator <(const cube_t& cb) const{}
    void operator =(cube_t& cb) const{}

and i tried to store step with a map

map<cube_t,int> m_Cube;

but that was not work correctly, the map cannot compare correctly bettween 2 the same cube_t and i have to changed to this

map<long long int,int> m_Cube;

and it work correctly.


answered 06 Dec, 10:38

binhla's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 08 Jun, 21:55

question was seen: 402 times

last updated: 06 Dec, 10:38