Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

MikeMirzayanov's blog

By MikeMirzayanov, 2 months ago, In English

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.

 
 
 
 
  • Vote: I like it
  • +3167
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it +13 Vote: I do not like it

Uiiii

  • »
    »
    7 weeks ago, # ^ |
    Rev. 2   Vote: I like it +10 Vote: I do not like it

    Hi MikeMirzayanov, thank you, this is awesome and I would suggest adding this feature: if you have a set of test cases and you only wanna copy only one of them, you just click on it with your mouse pointer. What do you think about this idea?

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

      And don't forget to add the number of the test cases:1.

»
2 months ago, # |
  Vote: I like it +29 Vote: I do not like it

Ah yes I can relax my eyes

»
2 months ago, # |
Rev. 5   Vote: I like it +88 Vote: I do not like it

sigma_g can u plz update your dark theme extension according to it?

link

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    Also This is good.

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +4 Vote: I do not like it

    I'll try to update my dark theme tomorrow if you want to use it. (Check my blogs)

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +20 Vote: I do not like it

      It was a quick fix, so I did it now. Should be working.

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

    You can use Dark Reader extension, it works well.

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

    Hey! Very sorry but I am not actively using CF anymore. I was notified of this issue on GitHub by two helpful community members last week (https://github.com/GaurangTandon/codeforces-darktheme/issues/46) and I had then immediately patched the issue. Please re-install the theme if you didn't get the updated version yet.

    Thanks to all of you for using my dark theme for so long, and hopefully this fix will help you to continue using it for longer! :-)

    If you ever face any issue, please notify me on my GitHub repository, and I will do my best to fix it asap.

    Cheers!

»
2 months ago, # |
  Vote: I like it +15 Vote: I do not like it

Amazing, sometimes when the test cases are pretty long it was a bit hectic in identifying particular cases and now this feature is just a life savior! Thanks a lot. Orz

»
2 months ago, # |
  Vote: I like it +54 Vote: I do not like it

The highlighting is cool. But I have just discovered this breaks test-case parsers like https://chrome.google.com/webstore/detail/competitive-companion/cjnmckjndlpiamhfimnnjmnckgghkjbl?hl=en-US .

Would it be possible to keep the old data around so it still gets parsed? Otherwise we would have to change the extension (not sure who maintains it)

  • »
    »
    2 months ago, # ^ |
    Rev. 3   Vote: I like it +83 Vote: I do not like it

    I just released Competitive Companion version 2.35.3 which fixes this issue. The update has already been published on GitHub Releases and Mozilla's AMO, and is pending review on the Chrome Web Store.

    Edit: the update is now also published on the Chrome Web Store. Depending on your browser it may take up to 24 hours for the extension to auto-update, or you can force it to update by re-installing the extension.

»
2 months ago, # |
  Vote: I like it +15 Vote: I do not like it

This is great! Now it will make it quicker to copy and paste a specific test case that is giving wrong output.

Do you by any chance have a plan to add test case numbers as well? (outside the input/output boxes) I think this will make it easier to see which input maps to which output.

»
2 months ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

awesome update! It's clearer to find out every single test case.

»
2 months ago, # |
  Vote: I like it +6 Vote: I do not like it

WoW,now it will be much easier to distinct each test case

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

This is a good feature hope you also add an option to turn it off or on as some test cases contain one line input output so normal one looks better here but for problems where a graph or multiple line input are there then this feature will be really awesome.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    I agree there should be an option to turn it off or on (near the test cases) so that one can turn it off or on whenever he/she feels like

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Great This format helps B/w is this color pattern was inspired from atcoder??

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Great update !

»
2 months ago, # |
  Vote: I like it -9 Vote: I do not like it

Another extension could be a small copy icon against each test case.

»
2 months ago, # |
  Vote: I like it +8 Vote: I do not like it

lol I saw this on a problem a while ago and originally thought my display was glitching, love the update though thanks mike :D

»
2 months ago, # |
  Vote: I like it +10 Vote: I do not like it

For people who prefer dark mode, this one works perfectly with this update and overall — Dark Reader

»
2 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Amazing, coz when test case contains multiple lines it sometimes becomes difficult to distinguish, this new feature will surely be a great help.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Now i won't be lost again!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks.

»
2 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Is it possible to do the same thing for the output (so it matches the input)?

»
2 months ago, # |
  Vote: I like it +31 Vote: I do not like it

Stripeforces

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Great! I can see the example more clearly

»
2 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Do we have an option to enable (or disable) it in mashups? Me and my friend were trying to think of problem ideas to make a CF round and one of our problem candidates were prepared and put in a mashup and a test case it looked like

this (I don't want to spoil the problem so some of the test cases are covered)

Is it that Mike decided to secretly enable for mashups? Because he said in above that it is only enabled in the past few rounds.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

a nice improvement

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

An indeed feature/improvement, I liked it!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

That's great!!!

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Very good initiative. But it would be great to have a official dark theme also. Best Wishes ❤️

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Beneficial update! It increases my quick readability of test cases. Thank you.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

great works. in my opinion, honestly, if the number of cases on the first line is displayed with other colors(or in other ways such as bold) which differ from real data would be better.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

A very good feature, and I don't have to strain my eyes to see each test, it's amazing

»
2 months ago, # |
Rev. 2   Vote: I like it +16 Vote: I do not like it

Great update, I think we can do the same thing for output too, no ? (like in this or this problem)

  • »
    »
    2 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Agree with you! it would be great if we can discriminate the outputs for the test cases as well.

    Hope everyone would be agree with us!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

That`s great!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

My competitive companion is not working properly after the update may you please do something for this?

»
2 months ago, # |
  Vote: I like it -16 Vote: I do not like it

I don't know why but I prefer the old theme

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Good luck to all. I hope this will be the best div2 I've ever participated in.♥

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Good Job!!

»
2 months ago, # |
  Vote: I like it +5 Vote: I do not like it

It should have been done much earlier. Matching the test cases would have been an eyesore. Thanks to Codeforces anyway.

»
2 months ago, # |
  Vote: I like it +27 Vote: I do not like it

Feature suggestion: copying only one of subtests. Maybe, this should be a button popping up when hovering the test. Of course, "1\n" should be prepended in this case to allow just pasting this subtest into participant's program.

»
2 months ago, # |
  Vote: I like it +29 Vote: I do not like it

Nice feature Can you make it for Output also?

»
2 months ago, # |
  Vote: I like it +5 Vote: I do not like it

This will definitely remind me to look at the sample carefully.

»
2 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Great! Thank you MikeMirzayanov for providing us with such a great platform

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Good!

»
2 months ago, # |
  Vote: I like it +121 Vote: I do not like it

Screenshot-2022-08-09-153306

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

cool!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Codeforces lord is even making it easier for our eyes. Thanks sir!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Very nice feature

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Great words!

»
2 months ago, # |
  Vote: I like it -6 Vote: I do not like it

I think it is a good idea to also colour the output accordingly.

»
2 months ago, # |
Rev. 2   Vote: I like it +76 Vote: I do not like it

It's a good idea. I suggest that the name of the variable appears when you move the mouse and it points to it in the input.

»
2 months ago, # |
  Vote: I like it +19 Vote: I do not like it

Official dark theme when? :P

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I use the Dark Reader extension on my browser and it gives great results.

    Only issue is that the colors in the logo are off, but that's very minor and could be fixable with proper configuration.

    Edit: for some reason the image isn't working and I can't figure out why so here https://imgur.com/a/SDONl8J

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Wonderful feature!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

A good idea!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Nice.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

»
2 months ago, # |
  Vote: I like it -11 Vote: I do not like it

Cool! But why outputs don't look like that?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

That's amazing! Thanks for your efforts.

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

This is an amazing addition, it really helps in finding the input for the ith case without having to count the lines. What can make it even better is if it was added for the output too so we can easily match every input with its respective output, and possibly a button in the settings to enable/disable the feature incase someone doesn't like it or because I imagine it will probably break some extensions users use.

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

<3

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

Thank you, I think if you do the same thing with output box, it will be better.

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

I think "T" need another color

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

This is a good thing. Our experience on codeforces will be better and better!

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

I won't forget to input $$$t$$$ and get a $$$\tt Wrong\;answer\;on\;test\;1$$$ any more. XD

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

    I added it to the default code of codeblocks because there are more problems with testcases than without.

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

This update however is tampering with the input section upon using "Competitive Companion" extension. Hopefully, that gets fixed as well :)

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

I need this thing in my console window, if you look at my old submissions you might see cout << " " << etc; in there, which I added just to tell input from output.

»
7 weeks ago, # |
Rev. 2   Vote: I like it +30 Vote: I do not like it

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.

If you already know about test cases, you can run author solution on each of test cases, check that concatenation of this separate outputs is the correct output and use them for highighting. Luckily the sample test cases are small

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

Great! Thanks!

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

Ohh man! sheiii!

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

Nice!It really helps me while debugging.

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

Nice update but there is a problem now! There is no newline character at the end of all test cases. When I copy and pasted testcases I have to manually insert newline. Can you fix this

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

very love the update. every codeforces contest makes me happy though i have to solve the problems at night.

now the high-lighted feature is very useful, i can see the different test case more clearly.

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

Codeforces has the best User Interface is my opinion among all online coding websites. Just love this website so much!

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

That releases my eye's stress , it's very good!

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

In the old system, when you copy&pasted the input, there was inserted a carriage return at the end of the text. Then, all test cases where executed once you pasted the input.

Now this carriage return is missing, and you have to insert it manually. It is specially confusing if you are debugging code, as you paste, get to the dubugging page, and then you have to change to the prompt screen to insert this return when the execution gets to the last case.

I suppose I will get used to it, but I think it was much better with the carriage return. I don't know if the new behaviour is intended or accidental. Anybody else has had problems with it?

Anyway, the visualization in different colors is great. Thanks for all!

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

Nice update MikeMirzayanov! I wanted to request to do the same thing for the sample output. It would help when output for each test case has to be multiple line like in 1714D - Покрась вхождениями. Thank you!

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

Great

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

very nice feature, I think it would help me achieve blue again fast :)

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

WowW,now it will be much easier to distinct each test case