• + 0 comments

    When you know Moebius transformations and check that you can work in Fp (with ), it's quite simple but laborious.
    Seems like no one succeded in Python before me (see leaderboard), so here a remark:
    I at first used some nice and clean classes to encapsulate

    • Fp with its arithmetic operations
    • Complex arithmetics (operating on pairs eg of type Fp)
    • Moebius transforms with multiplication and power

    Alas this solution was too slow for test cases 9ff, so i refactored it, completely removed any classes and subfunctions, to end up with simple (long!!) completely explicite formulas. This did it for all tests.