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!!!!
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 ...
سلام شما که خفنی اکسپت گرفتی می تونی تست غلط برا کد ما پیدا کنی؟ اگه حوصله داری، وقت داری، تستر نوشتن بلدی... البته خوبه اگه بلد نیستی یاد بگیری برا م۳ خیلی خیلی کمکت می کنه
I don't know. But I just submit your code using MS C++ compiler and it gives me verdict Wrong answer. Pretty Strange ..
strange! I replaced all "int" to "long long" and my code got AC! where do you think the problem was?
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!).
I did; but not about all of my variables. just for the one's which could overflow!
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. :)