Can someone help me understand the time complexity of submission #1 and #2? I don't understand why I got TLE on submission #1.

problem link : 1714E - Add Modulo 10

TLE submission #1 : 191420410

TLE submission #2 : 191295823

Thanks for your help.

# | User | Rating |
---|---|---|

1 | Benq | 3783 |

2 | jiangly | 3772 |

3 | tourist | 3706 |

4 | maroonrk | 3609 |

5 | Um_nik | 3591 |

6 | fantasy | 3526 |

7 | ko_osaga | 3500 |

8 | inaFSTream | 3477 |

9 | cnnfls_csy | 3427 |

10 | zh0ukangyang | 3423 |

# | User | Contrib. |
---|---|---|

1 | Um_nik | 185 |

2 | awoo | 182 |

3 | nor | 172 |

4 | -is-this-fft- | 170 |

5 | adamant | 169 |

6 | maroonrk | 165 |

7 | antontrygubO_o | 160 |

8 | SecondThread | 159 |

9 | dario2994 | 152 |

9 | kostka | 152 |

Can someone help me understand the time complexity of submission #1 and #2? I don't understand why I got TLE on submission #1.

problem link : 1714E - Add Modulo 10

TLE submission #1 : 191420410

TLE submission #2 : 191295823

Thanks for your help.

↑

↓

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/27/2023 19:24:56 (h2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

This code will enter an infinite loop when the input is 0.

This is correct:

Thank you so much, I didn't realize the constraints were between [0,1e9].