Ad
  • Custom User Avatar

    Is your algorithm covering the classes of 2181 to 2189? The next musical will be in 2195 and the classes that enrol in 2187, 2188 and 2199 will get to see that musical, leaving the classes of 2181 - 2186, the other six classes

  • Custom User Avatar

    Can you help me with this example?.

    I'm looking this random test with an answer of 56:

    start = 2075
    end = 2189
    musical_every = 15
    enrollment_duration = 8

    The years of musicals are below.

    [2075, 2090, 2105, 2120, 2135, 2150, 2165, 2180]

    Between each interval, 7 students won't see the musical and there are 7 intervals, so.
    7 * 7 = 49 students in total will miss the musical. The person who enroll in 2181 won't see
    the final musical in the end class. So 49 + 1 = 50. Where are the other six persons.

  • Custom User Avatar

    Not necessarily. There will always be a musical for the start class only unless the school does no musicals. For the end class, it will depend on the duration for a musical to take place and also the duration of enrolment in school.

  • Custom User Avatar

    So in the end class there will be also a musical no matter what?

  • Custom User Avatar

    hi, that won'tbe added here, since this version isn't supposed to handle such a kind of grid. But you can try your solution on the 2kyu version.

  • Custom User Avatar

    ooookayyy....... :/

    Weirdest thing: I tried your solution against the actual test suite and it works like a charm...

    1. copy your code
    2. reset the trainer
    3. refresh the page
    4. try again

    => ?

  • Custom User Avatar

    put backticks around the input otherwise the "coment engine" will chop some of them, thinking it's formatting.

  • Custom User Avatar

    (lots of "antipatterns", in there... Mostly because you don't know yet some tools that python provides) ;o

    Well, I'm surprised to realize I actually didn't ask for something...: what was the input, for what you described in the first message?

  • Custom User Avatar
  • Custom User Avatar

    hidden global variables

    to make it simple, if you answer "yes" to the following, here is your problem:

    tell me you don't have a dict as default argument of a function...?

  • Custom User Avatar

    again

    Ah? x) Well, your welcome again, then ;)

    mmmh... If you already use 3.6 here, it's a bit weird... Hard to tell without seeing your code, I'd say. Without it, I'd say to search for global variables. Or hidden ones... (tell me you don't have a dict as default argument of a function...? xs )

    Note: if you mark your post as spoiler, there is no chances I get a notification (hence the delay in my answer: went by somewhat "randomly"...)

  • Custom User Avatar

    wild bet:

    • your solution is dict based
    • locally you use a recent python version
    • here you didn't use 3.6...?
  • Custom User Avatar
  • Custom User Avatar

    I think you may have misunderstood. You ought to think about the entire time a class is enrolled. So 2173 will be in school up to 2190 and so on. Thus, the class of 2173 and 2174 will see a musical in 2174. You check if a musical happens at any point of a class' stay in school.

  • Custom User Avatar

    nope, since you didn't open the thread with any flag. ;)

    np, don't worry.

    cheers

  • Loading more items...