Блог пользователя ak82

Автор ak82, история, 3 года назад, По-английски

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!

  • Проголосовать: нравится
  • +39
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Reminder: Contest starts in 2 hours!

»
3 года назад, # |
Rev. 2   Проголосовать: нравится +23 Проголосовать: не нравится

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.

»
3 года назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

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. 
  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +4 Проголосовать: не нравится

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

    • »
      »
      »
      3 года назад, # ^ |
      Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

      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

      • »
        »
        »
        »
        3 года назад, # ^ |
          Проголосовать: нравится +4 Проголосовать: не нравится

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