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

Автор mblazev, история, 4 года назад, По-английски

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
  • Проголосовать: не нравится

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

Pinging everyone else to get attention BledDest vovuh MikeMirzayanov.

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

s̶h̶o̶u̶l̶d̶'̶v̶e̶ ̶j̶u̶s̶t̶ ̶u̶s̶e̶d̶ ̶p̶y̶t̶h̶o̶n̶

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

this might help link. feelsbadman T_T

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +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,

»
4 года назад, # |
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.

»
4 года назад, # |
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 &mdash; (a % b < 0);
}

bigint dc(bigint a, bigint b)
{
    if (b < 0) a = -a, b = -b;
    return a / b + (a % b > 0);
}
  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 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.