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

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

Last weekend the finals of Swedish Coding Cup took place. Results. Congrats to _h_ for winning!

The problems are available on Open Kattis; I think they are quite nice.

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

»
18 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It looks like the reference solution to Ligatures uses SIMD. If possible, how would one solve it without SIMD?

  • »
    »
    17 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I'm embarrassed to admit that the intended solution is the quadratic time bitset one, and I don't know of any subquadratic one. It should be possible to do it with regular 64-bit numbers at most 4x slower than the 0,37 s AVX2-based one on the Kattis leaderboard, which should pass, though you might have to do a fair bit of constant factor optimization.

    (I think it's an interesting exercise though precisely how to apply bitsets here, IMO it's far from obvious.)

  • »
    »
    17 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    How to see reference solution ?

    • »
      »
      »
      5 месяцев назад, # ^ |
        Проголосовать: нравится +11 Проголосовать: не нравится

      quite late, but it's here: https://github.com/Kodsport/swedish-coding-cup-finals-2021/blob/main/ligatures/submissions/accepted/sl_simd.cpp

      Also, linking some resources Simon mentioned when I asked him about SIMD, in case they're helpful:

      From Simon: