|
|
вернуться в форумTLE 8. How can I optimise my code? (Python) Послано Maksim 31 окт 2022 21:40 N =int(input()) Nl = [] for i in range(N): Nl.append(int(input()))
M = int(input()) Ml = [] for j in range(M): Ml.append(int(input()))
answerl = [] Nl = set(Nl) Nl = list(Nl) Nl.sort() for ni in Nl: for mi in Ml: if mi == ni: answerl.append(mi) else: continue
print(len(answerl)) Re: TLE 8. How can I optimise my code? (Python) |
|
|