1

In Problems Statements, Example Inputs Are Now Highlighted if Test Cases Are Use...

 2 years ago
source link: http://codeforces.com/blog/entry/105779
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

In Problems Statements, Example Inputs Are Now Highlighted if Test Cases Are Used

By MikeMirzayanov, 4 days ago,

c164a37e70461b3b6a0236b7e72c81c7f9b47d8d.png

Hello, Codeforces.

Look what an interesting thing I've been working on the last few days. Now, if a problem uses test cases and its validator is written in the recommended way (using setTestCase), then the example inputs are displayed using different colors.

Just follow the link and see how beautiful it turned out: https://codeforces.com/contest/1714/problems!

So far I have enabled this only for the last few rounds, but if everything works as intended, I will enable it for more rounds.

In order to support this, I had to tinker a lot. I made changes to testlib.h so that the validator can return test markup. Support for this markup required changes in various system services. But I think it's worth it!

The coolest thing is that it was possible to implement all this without changing existing problems. If a validator is used using the setTestCase feature, then this improvement can be applied to this problem.

Of course, it would be cool to have similar highlighting in example outputs as well. And even, say, synchronously highlight an input-output test case pair when hovering over. Unfortunately, standard checkers are often used, in which information about test cases is lost. Perhaps I'll apply some heuristics to make it work in most cases.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK