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

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

Problem: https://codeforces.net/contest/1459/problem/C

The algorithm is all about computing gcd of large integers, $$$4⋅10^5$$$ times. Haskell it seems is too slow for even this!

C++ code passes in ~ 1.3 sec.

But Haskell code exceeds TL (2 sec).

Switching from Integer to Int64 does not help a bit. Disappointing.

Any ideas on optimizing it?

Update: It turns out that the string based IO was slow. Using of Data.Text.IO fixed it.

  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится