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 1181 problems, 530544 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 2018-19 Online Round 1

by Alex on Oct 29, 2018 - 8:04:30 pm UTC
The Woburn Challenge is back for another season! We've awarded thousands of dollars in prizes last year and are excited to do it again this year.

To be eligible for prizes, you must complete this year's registration form (see even if you have participated last year. 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 1

When: Friday, November 16th, 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!

Woburn Challenge 2018 Finals Results

by Alex on May 13, 2018 - 9:52:48 pm UTC
The Woburn Challenge 2018 on-site finals was one for the books! We witnessed 25 teams from 13 schools battle it out for the coveted title of Woburn Challenge Champion. In the end, team William Lyon Mackenzie C.I. were victors of the junior division, narrowly inching out team 4 from Churchill Heights P.S. by a time penalty of 10 short minutes. Unfortunately, we were struck by the test data gremlins today. Due to incorrect data for problem J5/S3, Joey Yu and Zixiang Zhou are declared the conjoint champions of the senior division! The corrected version of the problem and data has been copied to the main judge, where in-contest submissions have been rejudged.

The senior division prizewinners are:
  • Joey Yu of Thornhill Secondary School ($250)
  • Zixiang Zhou of University Heights Public School ($250)
  • Brian Chau of Woburn Collegiate Institute ($150)
The junior division prizewinners are:
  • Yi Deng, Evan Zhang, and Jeffrey Gao of William Lyon Mackenzie Collegiate Institute ($150)
  • Aaron Tang and Robert Chung of Churchill Heights Public School ($100)
  • Bill Hu, David Tang, and Andrew Marin of University of Toronto Schools ($50)
Congratulations! For all online-round prizewinners who could not join us today, we will be getting in contact with your teachers shortly about sending your prizes by mail. We truly hope that you enjoyed tackling all the problems which we have prepared with love. Thanks to all the helping hands that made this event possible, as well as contestants and teachers alike, who stayed with us through to the end of the season. We would love to hear your feedback about how to improve for next year, so please send them to [email protected] That said, we hope you enjoyed the last round of the season and look forward to bringing you many more exciting challenges next year!

All of the problems have been cloned to the main judge and can be found here: J1, J2, J3/S1, J4/S2, J5/S3 (corrected!), S4, S5.
Full results, problems, and solutions are now posted at:

Woburn Challenge round 4 results are now available!

by Alex on Apr 23, 2018 - 1:30:16 am UTC
Thank you for joining us in our fourth online round, new and returning participants alike. Our anticipation for the premiere of Avengers: Infinity War is surpassed only by our anticipation for the finals next month! Problems, solutions, and test data are now posted here.

The senior division prizewinners are:
  • Brian Chau of Woburn Collegiate Institute ($100)
  • Zixiang Zhou of University Heights Public School ($50)
  • Alex Xu of White Oaks Secondary School ($25)
  • Joey Yu of Thornhill Secondary School ($25)
  • Ava Pun of Marc Garneau Collegiate Institute ($25)
  • Henning Jiang of Vincent Massey Secondary School ($25)
  • Sunny Lan of Richmond Hill High School ($25)
  • Andrew Tang of Erindale Secondary School ($25)
The intermediate division prizewinners are:
  • Michael Huang of Bell High School ($50)
  • Aaron Tang of Churchill Heights Public School ($25)
  • Yi Deng of William Lyon Mackenzie Collegiate Institute ($25)
  • Evan Zhang of William Lyon Mackenzie Collegiate Institute ($25)
Finally, a job well done to the top Junior finishers with perfect scores: Henry Guo of A.Y. Jackson S.S., Michael Sheinman of Grimsby S.S., Eric Gu of Glenforest S.S., and Robert Chung of Churchill Heights P.S. To all you juniors who are doing so well – we suggest moving yourself up to intermediate next year for an even greater challenge!

Congratulations! These prizes will be distributed as Visa gift cards during the on-site finals in May. Do not fret if you may not be able to make the final round in person – we will mail your prize to you afterwards.

P. S. The date and location of the finals will be released during the week, when invitations will also be distributed. Be on the lookout!

Pinned Posts

Recent Comments