Can someone explain how the following two "same" codes give different verdicts in C++11 and C++14 ?? TLE Code in C++ 11 and AC Code in C++ 14

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

1 | jiangly | 3860 |

2 | Benq | 3783 |

3 | maroonrk | 3627 |

4 | fantasy | 3526 |

5 | ko_osaga | 3500 |

6 | Um_nik | 3496 |

7 | tourist | 3487 |

8 | inaFSTream | 3477 |

9 | Radewoosh | 3437 |

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 | 158 |

9 | dario2994 | 151 |

9 | kostka | 151 |

**Sum Of Maximum's of all contigous sub-arrays of length k of a given Array.** for each k from 1 to n , seperatly. n is the length of the array. I am able to figure out an O(N^2) solution. But could not reduce the complexity further. It would be helpful if someone could tell a sub-quadratic approach.(Possibly O(n) ). This is in reference to this problem. Any help is appreciated. NOTE : the answer for each k has to be printed seperately. Thanks :)

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/01/2023 14:51:22 (k3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|