ak82's blog

By ak82, history, 2 years ago, In English

We invite you to participate in CodeChef’s Starters 29, in collaboration with Neuromancers, IIT-BBS, this Wednesday, 9th March, rated for Div 2, 3 & 4 Coders.

Time: 8 PM — 11:00 PM IST

Joining me on the problem setting panel are:

Neuromancers is the Programming Society of IIT Bhubaneswar and is proud to present CodeChef Starters 29. With an interesting problem set lined up, we promise to provide you with a challenge!

The video editorials of the problems will be available on our YouTube channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating. Good Luck!

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

| Write comment?
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

There's Topcoder happening at the same time, you guys should sync, https://codeforces.com/blog/entry/100704

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Reminder: Contest starts in 2 hours!

»
2 years ago, # |
Rev. 2   Vote: I like it +23 Vote: I do not like it

Now that the contest is over, I want to point out a huge flaw: Problem Max Heat (COST_MANIA) is same as 1554B Cobb with OR operation being changed to XOR operation and a simple check for A[i] <= j.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Sorry, this was unexpected and unknown to us. I couldn't find this problem while searching for it, otherwise this wont be there.

    • »
      »
      »
      2 years ago, # ^ |
      Rev. 2   Vote: I like it +3 Vote: I do not like it

      Don't be sorry. This problem helped me to become 5* on CodeChef.(◠‿◕)

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i got the idea from that problem too :v

»
2 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

In Decomposition Reaction Problem my approach of bfs on directed graph was giving me wrong answer can someone explain why ? Update: Solved with little tweak in my algorithm

I created a directed graph from the given equations like 
p -> a*q + b*r so adj[p] = {(q,a),(r,b)} ..now I will push element which are parent of themselves into the queue and apply bfs the transition would be :
for Childs for any node p
if  q is not visited if will push it to queue and increase a[q]+=a[p]*a
else do a[q]+=a[p]*a without inserting it in queue .
So in the end only leaf nodes will remain and rest will decompose .

also in mathematical operation I have taken care of MOD. 
  • »
    »
    2 years ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    Think of a graph like this 1->2 4->3 3->2 2->5.

    • »
      »
      »
      2 years ago, # ^ |
      Rev. 2   Vote: I like it +3 Vote: I do not like it

      Thanks a lot ...got an AC with little tweak in my algorithm .

      I created array par[x] which tells number of parent x currently has.
      Initially I am pushing all the nodes which have 0 parent to my queue. 
      then for child q of node p ,
      I am decrementing par[q] by 1
      if par[q] equals zero then pushing it to queue and increase a[q]+=a[p]*w
      otherwise just increase a[q]+=a[p]*w .
      

      My code

      • »
        »
        »
        »
        2 years ago, # ^ |
          Vote: I like it +4 Vote: I do not like it

        Congratulations. You just used Kahn's Algorithm for topological sorting.