ask_1171's blog

By ask_1171, 9 years ago, In English

Sometimes i wish to see the only the standings of the participants from my country. Is the any option in codeforces to do it ?

Read more »

 
 
 
 
  • Vote: I like it
  • +33
  • Vote: I do not like it

By ask_1171, 10 years ago, In English

   Is there any place in codeforces where the contest editorials can be found in a organized way ?

Read more »

 
 
 
 
  • Vote: I like it
  • +5
  • Vote: I do not like it

By ask_1171, 11 years ago, In English


I tried to solve this problem. But may be not getting it right... I believe my algo is very close to correcrt.. Any suggestion would be highly appreciated...

This is what i did.


//mapped all the 12 sticks to  bit of mask
//ith bit in mask  represents the stick is not removed  if 0 , and removed if 1


bool iswin(mask,mouse,cheese)
{
      // checked weather the mouse is reachable to cheese in present mask condition using dfs
      if(reachable)
          return false..

      flag = 0;
      
      for(i=0;i<12;i++)
       {
if(!(mask&(1<<i)))   // checked if the ith stick is already removed or not... if not it goes to next step..
                  {
                       if(!iswin(mask|(1<<i))) // checks is it a loosing position if ith stick is removed by the player..
                          {
                                flag=1;      // if he gets a reachable loosing position ...he is in winning position for sure....
                                break;
                          }
                  }
       } 

       return flag;
}

if SOHA is in winning position he is the winner else it is TARA

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it