Mindeveloped's blog

By Mindeveloped, history, 7 weeks ago, In English

I made my own script to filter problems in CF problemset. If such script with same function already exists you can ignore my post or downvote it.

This is a python 3 script that fetches all problems from CF problemset and allows custom filtering. It supports custom filter criteria in python expression format. After you input the filter function, it filters the problems and choose a random one. More details can be found in spoilers below.

Filter Expression
Code
  • Vote: I like it
  • +15
  • Vote: I do not like it

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

It does works well but sometimes it shows me this image

else it works fine sometimes

image

  • »
    »
    7 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    can you show what is your filter expression in the first case

    • »
      »
      »
      7 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I don't remember the exact filter expression.But this happens quite freqently image Also sometimes it gives the output after a lot of errors image

      • »
        »
        »
        »
        7 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Um. It seems that the pyjson module has some problems analyzing the json object received from Codeforces AI and making random fields None. What version of Python are you using now? Is there any problem with your internet connection (in case the data received might be altered)? I'm using Python 3.12 official distribution with pip install pyjson and never encountered this problem.

  • »
    »
    7 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    inspired me to add an error handling in the evaluating part, thanks