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

Автор sush2k3, история, 10 месяцев назад, По-английски

I was recently solving a 1400 rated problem : 1697C - awoo's Favorite Problem. The logic was pretty clear and i had implemented a simple solution 242716746. The code ended up failing at the 2000th input of testcase 2 and I have no idea why. I tried coming up with all possible testcases I could think of but of no help. As I already came up with the logic mentioned in the editorials, I am left helpless as only possible solution left is to look at other successful submissions but it doesn't really help my cause.

As a avid codeforces enthusiast who wishes to improve at competitive programming, it is a humble request to the developers if it is possible to come up with a way to view the particular testcase on which the code failed (not during a contest obviously) . I don't think there would be any downsides to implementing this for practice problems. Those who want can still try coming up with a possible failing testcase on their own without looking at the test details can do so, but also having the problem causing testcase at our disposal could help a lot. This is very similar to having editorials for all problemset problems in the sense that we would have access to a remedy which can help improve logic building and debugging skills.

It's been 2 years since I have been active on codeforces and have loved every problem solved and every contest I've participated in. It's the best platform out there for competitive programming and this is the first and only complaint I've had (not counting the inability to view the users who have added me as a friend XD). It would be a great quality of life change and would be much appreciated.

The rant ends here.

Thanks for reading. Love, sush2k3

Sidenote : Tips, guidance and profile review are welcome

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

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

Yes, I agree with you.

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

Not revealing the test data makes it harder to steal problems from the platform.

But maybe u can try to find the failing test case: Since the output format is 1 token per test case u know that u fail the 2000th test case. It should be possible to print the input when u reach the 2000th TC (all in 1 string without spaces) and hopefully the checker shows u everything u need.

Another solution would be to try stress testing against brute force or different AC solution.

  • »
    »
    10 месяцев назад, # ^ |
      Проголосовать: нравится -35 Проголосовать: не нравится

    Generating testcases is not hard so it isn't a big obstruction in stealing problems. Printing the test case isn't always feasible as test cases are often quite big.

    Stress testing ain't fun and if it isn't fun, why bother?

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

      debugging is not fun so why bother. Just move on to next problem

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

        I wish to know if my proofs are wrong though, why make everyone write their own stress tester for themselves if a counter already exists?, It's just unnecessary work

»
10 месяцев назад, # |
Rev. 3   Проголосовать: нравится +1 Проголосовать: не нравится

I think it would be both annoying to implement and let people try to cheese fastest times by directly looking into test cases. (actually DenjellBoone's argument is much stronger than mine)

Instead, you should learn how to stress test: https://youtu.be/JXTVOyQpSGM?si=OkPRGxNxG3-VQB8D

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

    Thankyou!! I wasn't aware of stress testing. Will definitely look into it!

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

FWIW, this is the testcase from CF Stress on which your code produces an incorrect answer.

Ticket 17289

»
10 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Write your own stress test generator

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

you can get the exact test case in this way for inputs on test case 2.
Submission
The exact test case is shown in the checker log

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

Skill issue

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

I think you learn more if you find the test case yourself. That is a really useful skill, since if you develop it you can find bugs/fake solves far easier. It might also help you solve constructive problems, because you literally practice constructing stuff