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 1037 problems, 305733 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)

A word on sockpuppets

by jargon on Jan 19, 2016 - 12:48:11 am UTC
Sockpuppeting is not an acceptable practice. Creating new accounts for the sole purpose of voting posts up or down is not permitted. When there were only one or two, that wasn't a big deal. But this is ridiculous, guys. I found about 20 sockpuppet accounts today.

Moving forward, I'll be deleting any sockpuppet accounts I find. We are able to link sockpuppets to main accounts. Be warned: your main account may suffer sanctions, including temporary or permanent bans from the site.

Woburn Challenge round 2 results are now available!

by Alex on Dec 14, 2015 - 8:31:19 pm UTC
Thank to all of you who took part in round 2, new and returning competitors alike! Problems, solutions, and test data are now available in the "Past Contests" section of this site. With our experience from the previous contest, we’ve rounded out the edges to make this one much smoother for everyone involved. We hope you enjoyed the Star Wars themed storylines that were prepared in tribute to the imminent release of The Force Awakens. While the plot of the film remains to be unveiled, we dare say that we’ve at least tried our hands at some bold forecasting in problems J4 and S4.

Click here for full results to the contest. Problems, solutions, and test data are now available here.

The senior division prizewinners for this round are:
  • Timothy Li of Don Mills Collegiate Institute ($200)
  • Leo Feng of Vincent Massey Secondary School ($100)
  • Spencer Whitehead of Lisgar Collegiate Institute ($50)
  • Ahmed Sabie of Glenforest Secondary School ($50)
  • Jeffrey Xiao of University of Toronto Schools ($50)
The junior division prizewinners for this round are:
  • Christopher DeGuzman of Glenforest Secondary School ($50)
  • William Huang of Woburn Collegiate Institute ($25)
  • Siddhant Jain of University of Toronto Schools ($25)
Congratulations to all of you! These prizes will be distributed as Mastercard gift cards, and we will be contacting your teachers shortly about sending them out. If you haven't won a prize, keep on practicing! We have many more prize opportunities for you throughout the year.

Woburn Challenge Online Round 2

by Alex on Dec 09, 2015 - 2:46:43 am UTC
Edit: The contest is over! Many thanks to all of you who participated. We will be posting prizewinners and analyses to all of the problems shortly. Check here, as well as our website periodically!

Edit 2: The contest problems have been posted to ( and also cloned to the main judge. Feel free to submit to them for practice while we work on publishing results and analyses.

Junior Problems: J1, J2, J3, J4
Senior Problems: S1, S2, S3, S4

Thanks to all of you that participated in round 1 and we hope you're ready for another. The format will be exactly like the first round. If you didn't participate last round, it is not too late to jump in now. New competitors can read more about the contest and register at If you have already registered through this process in round 1, you do not have to do it again. Once again, 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.

Online Round 2

When: Friday, December 11th, 2015 from 4:00 pm to 7:00 pm ET
Where: The PEG Judge interface (
Format: 2 divisions, 3 hours, 4 problems, infinite submissions, and live feedback.
  • Top 3 Junior division winners: $50, $25, $25
  • Top 5 Senior division winners: $200, $100, $50, $50, $50
Full format and rules can be found at:
For more details, visit For questions, email

Good luck and enjoy the problems!

Pinned Posts

Recent Comments