dmkozyrev's blog

By dmkozyrev, history, 8 years ago, translation, In English

I found two C# solutions: with multithreading — Accepted and without multithreading — TLE. The author of the solution uses Parallel.For in the functionMultiplyMatrixPow, due to which it achieves success. Question: how many cores can we load on codeforces servers when testing our solution?

UPD: In first program author takes remainder from integer division 3 times, in second program just 1 times. So, this is not multithreading hack.

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

»
8 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Look at mike's comment: blog.

»
8 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As far I know, you'll never decrease the running time on all adequate e-judges via additional threads, since they're single-cored. Your case is probably false-positive, I mean when I was writing solutions on C#, it could give different execution time on the server, and your code may give a result somewhere in an interval [2000-x, 2000+x] of milliseconds, almost randomly.