Hello, World!

Welcome to the PEG Online Judge. This site was created by members of Woburn Collegiate Institute's Programming Enrichment Group as a resource for competitive programmers everywhere. We also run PEGWiki, a site for information and tutorials of algorithms.

Currently, we have 1197 problems, 538184 submissions, 277 analyses, and support for 15 languages.

If you are new here, register an account and get familiar with the judge by solving A plus B. Alternatively, you can try a random problem that you haven't solved.

Announcements (See All)

Woburn Challenge round 2 results are now available!

by Alex on Dec 18, 2018 - 3:09:47 am UTC
Thank you for joining us in a new season, new and returning participants alike! This was the first online round in over two years without a perfect Senior score! Problems, solutions, and test data are now posted here.

The senior division prizewinners are:
  • Brian Chau of Woburn Collegiate Institute ($100)
  • Zixiang Zhou of London Central Secondary School ($50)
  • Henning Jiang of Vincent Massey Secondary School ($25)
  • David Tang of University of Toronto Schools ($25)
  • Royi Luo of Richmond Hill Secondary School ($25)
  • Dan Bo Yang of Iroquois Ridge High School ($25)
  • William Li of University of Toronto Schools ($25)
  • Sharujan Sreekaran of Glenforest Secondary School ($25)
The intermediate division prizewinners are:
  • Evan Zhang of William Lyon Mackenzie Collegiate Institute ($50)
  • Jason Xiong of University of Toronto Schools ($25)
  • Michael Huang of Bell High School ($25)
  • Yi Deng of William Lyon Mackenzie Collegiate Institute ($25)
Finally, we would like to applaud a job well done to the top Junior division finishers: Moses Xu of Appleby College, Eric Wang and Leo Tong of Glenforest Secondary School, and Allen Tao of Colonel By Secondary School.

Congratulations! These prizes will be distributed as Visa gift cards during the on-site finals in May to which all of the above winners are invited (more details to come later). Do not fret if you may not be able to make the final round in person – we will mail your prize to you afterwards. Remember that we will have many prizes in the remaining rounds of the year, so keep on practicing!

Woburn Challenge Online Round 2

by Alex on Nov 29, 2018 - 12:33:48 am UTC
Edit: The contest is over! Many thanks to all of you who participated. The questions have been cloned to the main judge. Problems, solutions, and test data have been posted to We will be posting prizewinners shortly. Check here, as well as our website periodically! Feel free to submit to them for practice while we work on publishing the results. Note that questions are shared between divisions. In particular, submissions to all intermediate problems are not moved over and intermediate competitors will have to resubmit them on the main judge.

Problems: J1, J2, J3/I1, J4/I2, I3/S1, I4/S2, S3, S4

Another round is coming your way. All newcomers are welcome, so don't miss it!

To be eligible for prizes, you must complete this year's registration form (see even if you have participated last year. If you have already completed in earlier rounds this season, you do not need to do so again. If you have an existing PEG Judge username, you can continue using it. All Canadian high school students are eligible for prizes (you must be first registered through the aforementioned website), but everyone with a PEG Judge account is welcome to participate.

2018-19 Online Round 2

When: Friday, December 14th, 2018 from 3:30 pm to 6:30 pm ET
Where: The PEG Judge interface (
Format: 3 divisions, 3 hours, 4 problems, infinite submissions, and live feedback.
  • Top 8 Senior division winners: $100, $50, $25, $25, $25, $25, $25, $25
  • Top 4 Intermediate division winners: $50, $25, $25, $25
Full format and rules can be found at:
For more details, visit For questions, email [email protected].

Finally, please forward this to your friends (especially at other schools) who are interested in computer programming -- we want to get more students involved!

Good luck and enjoy the problems!

Judge may be buggy after database issues

by bbi5291 on Nov 23, 2018 - 5:22:14 am UTC
Hi all,

Due to a failed database upgrade, some data were temporarily lost. Due to an unfortunate coincidence, the backups were temporarily unavailable, so I had to recover the data using some more sketchy means. I believe all data have been recovered successfully, but if you notice any unexpected errors over the next few weeks, please report them here.

Pinned Posts

Recent Comments