I have two almost identical submissions getting a substantial difference in execution time:
TLE submission uses variable MOD inside the main function:
def main():
MOD = 998244353 # local var
...
main()
and the AC submission uses variable MOD outside:
MOD = 998244353 # global var
def main():
...
main()
Any idea what causes such a difference in performance?