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

×

please tell me the algorithm of H1 code.

0
1

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

0★sayan__1995
1
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
link

answered 09 Jun, 16:08

ssp547's gravatar image

4★ssp547
3077
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.

link

answered 06 Dec, 10:38

binhla's gravatar image

0★binhla
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×138
×20
×9
×7

question asked: 08 Jun, 21:55

question was seen: 402 times

last updated: 06 Dec, 10:38