Блог пользователя firedrakesin

Автор firedrakesin, история, 3 года назад, По-английски

https://codeforces.com/contest/1574/submission/129708228 whats wrong with this code can't know the edge case so, not able to know what is wrong.

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

The test case is 1 4 4 3

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    How did you know .. that's wow.... Thank You

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится +8 Проголосовать: не нравится

      Method to find such counterexamples:

      • Write a very naive and simple solution to the problem (maybe exponential complexity) (if you can, you may also just copy someone else's solution)
      • Write a program to generate thousands of small (!) test cases
      • Using those two, find a test case where your program gives the wrong answer