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

Автор moji, 11 лет назад, По-английски

Hey all! The problem doesn't look much difficult, It is easily reduced to a knapsack problem. But I got a strange problem with it! the code below gets: Idleness limit exceeded on test 9 The code: http://paste.ubuntu.com/5673644/ I've shown my problem to some people but no body understood what's the problem. CAN ANYBODY HELP!!!!

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

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

I think your code has problem... I get accepted so everything with CF is ok... But aslo I can't find any mistakes in your code ...

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

سلام شما که خفنی اکسپت گرفتی می تونی تست غلط برا کد ما پیدا کنی؟ اگه حوصله داری، وقت داری، تستر نوشتن بلدی... البته خوبه اگه بلد نیستی یاد بگیری برا م۳ خیلی خیلی کمکت می کنه

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

I don't know. But I just submit your code using MS C++ compiler and it gives me verdict Wrong answer. Pretty Strange ..

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

strange! I replaced all "int" to "long long" and my code got AC! where do you think the problem was?

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

    When u see print result modulo a nine-digit prime number (1000000007), in case your variables do not overflow, take them long long (maybe it needs BigInteger!).

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

      I did; but not about all of my variables. just for the one's which could overflow!

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

    I once got idleness limit exceeded verdict due to the problem with array size which i think should be Runtime Error. Here due to the overflow of some variable, if you use that variable for accessing array elements your code may access some negative index. Though i am not sure this may be the reason of getting this verdict. If you learn the true reason behind this verdict please let me know. :)