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, 535663 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 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.

Woburn Challenge round 1 results are now available!

by Alex on Nov 17, 2018 - 10:59:32 pm UTC
Thank you for joining us in a new season, new and returning participants alike! This round was certainly a learning experience for us. The system has been improved, so we are hoping for the best in round 2. Problems, solutions, and test data are now posted here.

The senior division prizewinners are:
  • Zixiang Zhou of London Central Secondary School ($100)
  • Andrew Qi Tang of Erindale Secondary School ($50)
  • Royi Luo of Richmond Hill High School ($25)
  • Sunny Lan of Richmond Hill High School ($25)
  • Alex Tianyi Xu of White Oaks Secondary School ($25)
  • Michael Huang of Bell High School ($25)
  • Anish Mahto of Turner Fenton Secondary School ($25)
  • Brian Chau of Woburn Collegiate Institute ($25)
The intermediate division prizewinners are:
  • Evan Zhang of William Lyon Mackenzie Collegiate Institute ($50)
  • Aaron Tang of Churchill Heights Public School ($25)
  • Yi Deng of William Lyon Mackenzie Collegiate Institute ($25)
  • Robert Chung of Woburn Collegiate Institute ($25)
Finally, we would like to applaud a job well done to the top junior division finishers: Albert Lai and Jerry Zhu of Pierre Elliott Trudeau High School, Eric Pu of Stephen Lewis Secondary School, and Eric Wang of Glenforest 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!

Pinned Posts

Recent Comments