aman_naughty's blog

By aman_naughty, history, 5 weeks ago, In English,

Problem Link : link

code link : code

In the bfs part I am extracting nodes at a given level and then in help function I am greedily sorting the CT and TT by CT time in acsending order as we want the developer to finish the module code asap so that the tester can attend to it. Also I believe that it doesn't matter if we process level 1 first and then subsequent levels as I am adding the time of each level to my answer. Why is this code giving WA. Any help is appreciated.

P.S- No one was able to solve this problem in the contest and thus it seems an interesting problem.

 
 
 
 
  • Vote: I like it  
  • -16
  • Vote: I do not like it  

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by aman_naughty (previous revision, new revision, compare).

»
5 weeks ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Link for your code is private. Can you share it through ideone or pastebin?

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by aman_naughty (previous revision, new revision, compare).

»
5 weeks ago, # |
  Vote: I like it -9 Vote: I do not like it

Errichto help please....

»
5 weeks ago, # |
  Vote: I like it +13 Vote: I do not like it

I don't fully understand your explanation. By level you mean some depth (distance from the root)? We shouldn't group by that. The problem looks like bottom-up dp on tree.

If you don't know why your solution is wrong, write a brute force and compare them on random tests. More info: Asking for help FAQ.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes by level I mean depth.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can you please tell if the code to solve the subproblem is correct or not.

      Sub problem: given developer time array and tester time array find minimum time to completely develop and test all modules and tester can only test a module provided developer has coded it.

      My approach : Sort both arrays according to developer time in increasing order because we want to develop modules asap so that the tester can test it asap. Can you provide a counter case where my approach fails . Here is the code I am taling about.

      code

      d array is for developer and t array is for tester and a array is just storing the pairs of developer tester time for facilitating sorting.

      • »
        »
        »
        »
        5 weeks ago, # ^ |
          Vote: I like it +10 Vote: I do not like it

        I told you to test it against a brute force...

        It's incorrect. One item with develop=10, test=1, the other develop=11,test=10.

        • »
          »
          »
          »
          »
          5 weeks ago, # ^ |
            Vote: I like it -6 Vote: I do not like it

          My answer is 32 which I believe is correct for input

          1

          2

          1 2

          10 1

          11 10

        • »
          »
          »
          »
          »
          5 weeks ago, # ^ |
            Vote: I like it -18 Vote: I do not like it

          hello.......

          • »
            »
            »
            »
            »
            »
            5 weeks ago, # ^ |
              Vote: I like it +12 Vote: I do not like it

            I told you two times what to do. I'm not going to help you more before you do that.

            • »
              »
              »
              »
              »
              »
              »
              5 weeks ago, # ^ |
                Vote: I like it -19 Vote: I do not like it

              How to write brute force solution even that's a mystery

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    No edotorial is published for external contest on codechef and no one as of now has solved it so I am asking here.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      dont take this question so seriously, if you are not able to solve it.Then leave it. The Problem may be too hard. Why do you want to solve the one which is solved by none.

      • »
        »
        »
        »
        5 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        "Why do you want to solve the one which is solved by none."--- cuz that's what defines me and makes me different from others .

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it -17 Vote: I do not like it

    My color changed but still no reply xD