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

Автор ADJA, история, 6 лет назад, По-английски

Hello, CF community.

I am writing about algorithms for fun and to spread the knowledge.

Please read my new article about stress testing – a useful technique to automatically find bugs in your solution: http://www.algos.school/stress-testing

Would you be interested in the future algorithm articles like this? Please follow algos.school on facebook, twitter, or telegram.

Thanks!

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

»
6 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +27 Проголосовать: не нравится

I don't like your generator and script. Using time as seed gives you the same test within a second, so you will check only 60 tests per minute. And your script is quite long + you don't see that tests are indeed being checked.

Instead, use argument argv[1] as seed and consider the following script:

for((i=1;;++i)); do
  echo $i
  ./gen $i > int
  diff <(./solution < int) <(./stupid < int) || break
done

I appreciate the effort and more educational blogs is great, but do some research first and see how others do the same thing.

  • »
    »
    6 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    Hey, thanks for checking this out!

    Using time as a seed is a nice catch. I copied some old code of mine (2013?), and didn't pay enough attention to that. I will fix this in the article.

    Regarding the length of the script, I believe it's not that much longer than yours – your version omits all comments and compilation part. When writing the article, I was trying to make script as readable as possible, not short. That said, I can definitely tweak my script a bit more, thanks for an example!

    And about research: I read everything I could on the topic, but there are not many good sources that I found – that was one of the reasons to write my article as well :)

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Very well! I liked this topic and the project Algos.school as a whole, although I hear about it now! My question is: will you promote this site in the future with more resources?