FHVirus's blog

By FHVirus, history, 5 months ago, In English

Hello Codeforces! Today I feel like thirsty for contribution, so I'll share some trick to get (almost) unlimited amount of (almost) square grid paper during contest, and hope that I will get some contribution.

If you use Vim, open an empty file and type the following from normal mode:

i+<esc>25A---+<esc>
o|<esc>25A   |<esc>
ggVGyG35pGdd

Then you will get this: Da Grid

The Vim commands are basically just doing the copy-and-paste part for you. If you don't use Vim, you can manually produce the pattern instead.

The grid is 101 characters wide * 71 characters high, or 25 cells wide * 35 cells high. 101 * 71 characters roughly matches domjudge's upper limit for printing, but please test it in testing session. This trick has been tested in 2023 Taoyuan regional, and the staff have approved this trick.

Since the grid cells are (almost) square, you can use them in DP and Geometry problems. Happy printing!

P.S. Please don't print more than you need. Some people got warning from juries for printing 10+ pages of grid paper during testing session.

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

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

Some vim golf, your last line can be replaced with this, saving some keystrokes :0

ggyj35PGdd
  • »
    »
    5 months ago, # ^ |
      Vote: I like it +13 Vote: I do not like it

    Are we playing vimgolf?

    i|<esc>25A   |<esc>
    o+<esc>25A---+<esc>
    Vky35Pdd
    
    • »
      »
      »
      5 months ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      I guess we are playing vimgolf!

      35i---+<enter>   |<enter><esc>dk
      <c-v>gg$y25P<c-v>Gx..
      
      • »
        »
        »
        »
        5 months ago, # ^ |
        Rev. 4   Vote: I like it +18 Vote: I do not like it
        35i+---+<enter>|   |<enter><esc>dk
        l<c-v>gg$y24P
        

        My original solution: 30
        Your solution: 29
        My solution: 27

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

          Ah yes vimgolf!

          One key less:

          35i+---+<enter>|   |<enter><esc>dk
          l<c-v>{$y24P
          
»
5 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I'm confused, why don't you just use scrap paper

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

    Because they are not like a grid

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

God-tier blog

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

I'm confused, why don't you bring grid paper with you beforehand

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

    I am confused , why not just draw some horizontal lines and vertical lines on a whiteboard!!

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

    Some regionals (e.g. Taoyuan) don't let contestants bring extra paper, so we might have to sacrifice some spaces in our codebook if we want to bring pre-printed grid paper.

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

      Oh so there are some constraints e.g. 20 pages at most? Then that's understandable.

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

I think I'm the only person who use Excel for visualizing dp :)