Sort 46 Discussions, By:

Sorry, you do not have a permission to answer to this question.

  • kevin_atienza 7 years ago + 1 comment

    Please don't post hints, spoilers, codes or ask for help before the contest ends. If you do that, you might get disqualified.

    Please read the FAQ page before asking any questions.

    The meaning of different verdicts like segmentation fault, abort called, etc., can be found here.

    Add Reply Preview cancel

    Sorry, you do not have a permission to answer to this question.

    • Abhinav36 7 years ago + 1 comment

      It would be nice if you guys act quick when somebody gives major hints and delete the comment .

      Add Reply Preview cancel

      Sorry, you do not have a permission to answer to this question.

      • marton_antoni 7 years ago + 0 comments

        Would be even better to use pre-moderated forums for competitions.

        Add Reply Preview cancel

        Sorry, you do not have a permission to answer to this question.

    • xuanyu_wang 7 years ago + 1 comment

      Here is a fact: even you do type 1 operation by adding 1 to each number in the range, the needed time beyond the time limit. So, take more considerations.

      Add Reply Preview cancel

      Sorry, you do not have a permission to answer to this question.

      • Manikanta2498 7 years ago + 0 comments

        any clue for this fact :/

        Add Reply Preview cancel

        Sorry, you do not have a permission to answer to this question.

      • NiceBuddy 7 years ago + 3 comments

        Its depressing when the code working perfectly, and only two tests passes. Even after using DP for factorials and different algorithmic functions for better efficiency, I still could not pass all. :(

        Add Reply Preview cancel

        Sorry, you do not have a permission to answer to this question.

        • vds_tanuj4567 7 years ago + 1 comment

          [deleted]

          Add Reply Preview cancel

          Sorry, you do not have a permission to answer to this question.

          • TMW98 7 years ago + 0 comments

            same used dp for factorials and other things but still two cases passed :'(

            Add Reply Preview cancel

            Sorry, you do not have a permission to answer to this question.

          • anshumanc007 7 years ago + 0 comments

            see...factorial is not a problem here...no of operation may be the problem...

            Add Reply Preview cancel

            Sorry, you do not have a permission to answer to this question.

            • ketakilolage97 7 years ago + 0 comments

              yeah, time runs out for the other cases.

              Add Reply Preview cancel

              Sorry, you do not have a permission to answer to this question.

            • eugalt 7 years ago + 2 comments

              Here is my approach.

              For each value less than 40 maintain an ordered array of indices such that .

              For operation 1 we need to replace a range of indices in each array with the corresponding range of array , for operation 2 we take the sum of times the length of the range of the corresponding array for all , for operation 3 we delete the index from an array if the previous value was less than 40 and insert the index into an array if the new value is less that 40.

              Solution

              Add Reply Preview cancel

              Sorry, you do not have a permission to answer to this question.

              • stringray 7 years ago + 0 comments

                cool approach,

                Add Reply Preview cancel

                Sorry, you do not have a permission to answer to this question.

                • jhaight 7 years ago + 1 comment

                  Thanks for sharing. How did you realize that values >= 40! will add 0 to the result? Is there some insight that led to this? I don't think I'd ever have arrived at that discovery on my own.

                  Add Reply Preview cancel

                  Sorry, you do not have a permission to answer to this question.

                  • eugalt 7 years ago + 2 comments

                    The first thing you notice is the strange modulus value, which is normally a large prime (), not a power of 10. Then you observe that when computing a factorial by multiplying consecutive numbers each time you hit a multiple of you add trailing 0's to the product. , so among the numbers from 1 to 40 we have 8 multiples of 5, one of which is , and thus has 9 trailing 0's.

                    Although there is a shortcut - come to the discussion area at the right moment and see some kind soul sharing this information for free. :)

                    Add Reply Preview cancel

                    Sorry, you do not have a permission to answer to this question.

                    • dassu 7 years ago + 0 comments

                      soul LOL :D

                      Add Reply Preview cancel

                      Sorry, you do not have a permission to answer to this question.

                      • jhaight 7 years ago + 0 comments

                        Haha. Thanks for explaining how I could actually calculate it out without the shorcut. It definitely struck me that the mod value was different and that should help just couldn't work out how on my own.

                        Add Reply Preview cancel

                        Sorry, you do not have a permission to answer to this question.

                  • S1LV3R_J1NX 7 years ago + 1 comment

                    only 1st test case is passed and 1 test case failed and rest are T.O. I am using python any suggestions?

                    Add Reply Preview cancel

                    Sorry, you do not have a permission to answer to this question.

                    • ASHWIN_18 7 years ago + 2 comments

                      ur logic is wrong....... im getting all except two as timeout

                      Add Reply Preview cancel

                      Sorry, you do not have a permission to answer to this question.

                      • S1LV3R_J1NX 7 years ago + 0 comments

                        Where am I gng wrong?

                        Add Reply Preview cancel

                        Sorry, you do not have a permission to answer to this question.

                        • ojhasaurabh2099 7 years ago + 0 comments

                          how did you do it??

                          Add Reply Preview cancel

                          Sorry, you do not have a permission to answer to this question.

                      1. Challenge Walkthrough
                        Let's walk through this sample challenge and explore the features of the code editor.1 of 6
                      2. Review the problem statement
                        Each challenge has a problem statement that includes sample inputs and outputs. Some challenges include additional information to help you out.2 of 6
                      3. Choose a language
                        Select the language you wish to use to solve this challenge.3 of 6
                      4. Enter your code
                        Code your solution in our custom editor or code in your own environment and upload your solution as a file.4 of 6
                      5. Test your code
                        You can compile your code and test it for errors and accuracy before submitting.5 of 6
                      6. Submit to see results
                        When you're ready, submit your solution! Remember, you can go back and refine your code anytime.6 of 6
                      1. Check your score