Someone hacked my solution of problem D. Now it says WA. But I can't find any mistake. Please help me to find the mistake. My submission: https://codeforces.com/contest/1520/submission/115269582

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

1 | Radewoosh | 3707 |

2 | Benq | 3691 |

3 | tourist | 3669 |

4 | ecnerwala | 3565 |

5 | Um_nik | 3533 |

6 | ksun48 | 3489 |

7 | maroonrk | 3457 |

7 | jiangly | 3457 |

9 | Petr | 3370 |

10 | scott_wu | 3350 |

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

1 | 1-gon | 207 |

2 | awoo | 186 |

3 | rng_58 | 184 |

4 | Errichto | 182 |

5 | SecondThread | 177 |

5 | Radewoosh | 177 |

7 | -is-this-fft- | 176 |

7 | maroonrk | 176 |

9 | Um_nik | 173 |

10 | antontrygubO_o | 170 |

Someone hacked my solution of problem D. Now it says WA. But I can't find any mistake. Please help me to find the mistake. My submission: https://codeforces.com/contest/1520/submission/115269582

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/16/2021 05:02:35 (j2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

In fact, you should also calculate the negative numbers.

Utsa2000, Baylor_ is the someone who hacked your solution :P

Thank you. I understand now. I should use map.

For $$$a_i-i<0$$$ , you should calculate them instead of just ignoring them :(

Yeah I understand now thank you for you suggestion. I thought j > i so I must need a[j] > a[i]. But I am dumb I forgot that I was calculating a[i] — i not a[j] — a[i].

problem D is really a war