New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed when parsing time limit and memory limit on UOJ #75
Comments
Here's a list of problems which don't satisfy the above regex, I've removed the answer-only problems which don't have time and memory limits.
|
My suggestion is to ignore these irregular problems, and I can contact the admins to fix them. |
But you can use the two regexes above, they cover most problems. |
The admin said he will add a regular time/memory limits system to take place of the current time/memory limits. We can wait until it's done, or use the above regexes before he's finished. |
Nevermind, back to the original plan, I'm waiting until there is a more structured system for the time/memory limits because your regex only works on the initial html, not on the html after it has been formatted using MathJax. |
I've improved the time and memory limit parsing for UOJ in 9f0eab3...197e83c. These changes work correctly on all the problems you listed except for 451 and 452 because those problems use a non-standard way of displaying time and memory limits. In case it fails to parse the limits it now falls back to a default time limit of 1000 ms and a default memory limit of 1024 MB. These changes will go live in 2.16.0 which I am planning to release within the next few hours. |
As I mentioned in #64, there are many irregular time/memory limits on UOJ.
Most time limits are in this regex format:
时间限制(?:</strong>)?(?::|:)(?:</strong>)? ?\$.*?([1-9][0-9]*).*?\$
.Most memory limits are in this regex format:
(?:空间|内存)限制(?:</strong>)?(?::|:)(?:</strong>)? ?\$.*?([1-9][0-9]*).*?(M|G)B.*?\$
.However, there are still a few problems which don't satisfy these two rules, and there may be more irregular forms in the future.
The text was updated successfully, but these errors were encountered: