mblazev's blog

By mblazev, history, 5 years ago, In English

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

  • Vote: I like it
  • +108
  • Vote: I do not like it

»
5 years ago, # |
  Vote: I like it +30 Vote: I do not like it

Pinging everyone else to get attention BledDest vovuh MikeMirzayanov.

»
5 years ago, # |
  Vote: I like it +9 Vote: I do not like it

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

»
5 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

this might help link. feelsbadman T_T

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    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 years ago, # |
Rev. 2   Vote: I like it +33 Vote: I do not like it

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 years ago, # |
Rev. 3   Vote: I like it -8 Vote: I do not like it

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);
}
  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.