Skip to content
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

Closed
ouuan opened this issue Mar 29, 2020 · 6 comments
Closed

Failed when parsing time limit and memory limit on UOJ #75

ouuan opened this issue Mar 29, 2020 · 6 comments

Comments

@ouuan
Copy link

ouuan commented Mar 29, 2020

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.

@ouuan ouuan changed the title Failed when parsing time limit for UOJ Failed when parsing time limit and memory limit on UOJ Mar 29, 2020
@ouuan
Copy link
Author

ouuan commented Mar 29, 2020

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.

317
349
395
411
412
413
451
452
454
457
459
472
473
475
476
477
481
482
483
484
485
486
494

@ouuan
Copy link
Author

ouuan commented Mar 29, 2020

My suggestion is to ignore these irregular problems, and I can contact the admins to fix them.

@ouuan
Copy link
Author

ouuan commented Mar 29, 2020

But you can use the two regexes above, they cover most problems.

@ouuan
Copy link
Author

ouuan commented Mar 29, 2020

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.

@jmerle
Copy link
Owner

jmerle commented Mar 29, 2020

I'll wait until it's done, unless that takes longer than expected (lets say 2 weeks) in which case I'll publish a version using your regex.

I'm adding your regex to the UOJ parser, but I'll wait with publishing it to give the admin some time to implement the feature, unless I have another feature to publish before that happens in which case your regex will be shipped with it (I hope to implement #74 next week).

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.

@jmerle
Copy link
Owner

jmerle commented May 11, 2020

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.

@jmerle jmerle closed this as completed May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants