### mblazev's blog

By mblazev, history, 5 weeks ago, ,

So i used Arpa's bigint for today's C: https://codeforces.com/blog/entry/22566 and got skipped. Isn't it allowed to use code written before contest? What's going on here fcspartakm?

• +108

 » 5 weeks ago, # |   +30 Pinging everyone else to get attention BledDest Vovuh MikeMirzayanov.
 » 5 weeks ago, # |   +9 s̶h̶o̶u̶l̶d̶'̶v̶e̶ ̶j̶u̶s̶t̶ ̶u̶s̶e̶d̶ ̶p̶y̶t̶h̶o̶n̶
 » 5 weeks ago, # | ← Rev. 2 →   +3 this might help link. feelsbadman T_T
•  » » 5 weeks ago, # ^ |   +1 Well yeah, I would guess contest authors are aware of codeforces rules... the code was written and published/distributed before the start of the round,
 » 5 weeks ago, # | ← Rev. 2 →   +33 Sure it is a false positive plagiarism detection issue. It happens rarely. But did you read the comment from the system? It gives you a standard way to resolve such issues. No need to write posts like this. UPD: Sorry, I don't know why you didn't receive a message about the violation. I'll investigate it.
•  » » 5 weeks ago, # ^ |   +35 I didn't get any message.
 » 4 weeks ago, # | ← Rev. 3 →   -8 Hi went through your solution. I am unable to understand couple of things.What is the purpose of substracting and adding 1 for upper k or lower k?Thanks bigint df(bigint a, bigint b) { if (b < 0) a = -a, b = -b; return a / b — (a % b < 0); } bigint dc(bigint a, bigint b) { if (b < 0) a = -a, b = -b; return a / b + (a % b > 0); } 
•  » » 4 weeks ago, # ^ |   0 Those are div floor and div ceil functions and they do exactly that. The inequalities for k come from requirement that solution is greater or equal to zero.