CodeChef Matches challenge
The whitespace needs a lot of changes to be PEP8-compliant. The capitalisation is also unconventional: functions and variables in Python usually start with a lower-case letter.



The meaning of Player is not entirely clear, and the logic is hard to follow because of that. The convention for this type of combinatorial game is to denote a position as "N" (Next player wins) or "P" (Previous player wins). So I think that Solve should be renamed position_is_N, and then the Player variable becomes unnecessary.

if condition: return doesn't need a following else:.

The loop can be tidied up considerably with range and any. I think this is equivalent:

@lru_cache(maxsize=None)
def position_is_N(x, y):
    return x % y == 0 or \
           any(not position_is_N(max(x2, y), min(x2, y))
               for x2 in range(x % y, x, y))


A comment about the constraint that x &gt;= y would be nice.




  range of both X and Y is 1 to 10^18


Consider inputs 10**18, 3 (or other similarly small y). How many times might the loop run in the worst case?

As a rule of thumb, for a challenge like this if you need to do anything more than 10**9 times your algorithm is wrong. I can only suggest that you will need a complete rewrite to pass the time limit, so you should build a table of small values and see whether you can spot and prove a pattern. The problem is probably far more about mathematics than programming.