~pribeiro/

Programming contests

Skip to: roles · history · contestant record · discussion sessions · my problems

I have a strong connection with all kinds of programming contests. I feel that they can be a huge motivation factor for students, helping in the promotion of computer science and the desire for always knowing more.

For a more complete list of the prizes I got in the contests I participated see my contestant record. For a more textual description of my involvement in contests or for a list of my problems, continue in this page.

Current roles

Past organization

Awards

History

Olympiads in Informatics

It all started when I was 15 years old and still in high school, influenced by my brother. While still on 9th grade I participated in the National Olympiads in Informatics (ONI) and I was the youngest contestant. I was 2nd in the national finals and obtained the right to represent Portugal in the International Olympiads in Informatics (IOI) in the Netherlands. I also got the opportunity to participate in a training campus organized by Prof. Pedro Guerreiro which proved to be very influential on good programming techniques.

From there it all started to be part of my life. While I was still at high school, I entered three more editions of ONI and got the 1st place in all of the national finals. With that, I represented Portugal in three more IOI’s, held at Hungary, South Africa and Portugal.

Nowadays I cannot participate but I’m still actively involved in the community. I’m leading the organization of the National Olympiads (together with my former student Pedro Paredes and APDSI). I organize the national finals and team selections at my department and I’m also active on the scientific side (as a problemsetter and coach) and I am currently the portuguese team leader at the IOI (from 2005 to 2008 I was the deputy leader and since 2009 I’m the team leader) and also at other international high-school competitions such as the Ibero-American Olympiads in Informatics (OII) and the Western-European Olympiad in Informatics (WEOI). In 2012 and 2013 I was also responsible for organizing OII.

ICPC Competitions

When I entered the university, I promoted programming competitions and basically helped in the first experiences in my faculty on that field in the ICPC International Collegiate Programming Contest, which is a team contest (up to three students), in opposition to the Olympiads, which are individual. In this endeavour I was immensely helped by Prof. Fernando Silva, who believed in me and in competitive programming and helped in all aspects.

In 1999 I entered my first Southwestern Europe Regional Contest (SWERC) obtaining the 11th place among teams from 4 different countries.

In 2000 the University of Porto Programming Contest (CPUP) was started, with teams from several departments, and I won that first edition. In SWERC'2000 I was now 2nd (still the best rank of a portuguese team at SWERC, equalled in 2023 by a team I coached), but failed the qualification for the world finals by a single place (only one team passed at that time - the next edition saw 2 teams advancing but also more countries participating: Switzerland, Austria and Germany.).

I then proceeded to win all editions of CPUP I participated in (2000 to 2003), gaining the right to represent my university at SWERC level, where I was always part of the best portuguese team. During those years I helped in founding the Maratona Inter-Universitária de Programação (MIUP), the portuguese ICPC contest, with teams from all over the country. I won all the editions of that contest that I participated in, from 2001 to 2003.

While training, among several other sites, I dedicated some time to the UVA Online Judge (the most well known at that time), in which I solved more than 600 programming problems.

Nowadays I cannot participate as a contestant but I’m an active problemsetter and organizer. I am part of the scientific committee of MIUP, and I coach the university teams. In 2012 and 2015 I was the director of MIUP and I hosted it at DCC/FCUP. From 2014 to 2016 I was involved in the organization of SWERC at my department and I was also involved on the organization of the ICPC World Finals 2019 and the 2025 ICPC Europe Championship, both held at Porto.

IEEEXtreme Programming Contest

I was part of the scientific committee of the IEEEXtreme Programming Contest in 2008 and 2009, authoring several problems.

Logical Programming Contests

All the afore mentioned contests use imperative programming (I mainly use C/C++). In 2003 I decided to experiment another programming paradigm in contests and I participated for the first time in the National Logic Programming Contest (CENPLF), working in Prolog. The contest had an open division, in which post-graduate students could participate and I got the global first place.

I repeated the experience in 2004 and 2005 (where the contest gained a functional arm, with Haskell being permitted) and in both years I repeated the global first place.

Bebras - International Challenge on Informatics and Computational Thinking

I always wanted to promote computational thinking and computer science for even younger ages and in 2019 I started the portuguese edition of the Bebras, an international initiative aiming to promote Informatics (Computer Science, or Computing) and computational thinking among school students at all ages

I organize Bebras PT together with TreeTree2 and we challenge students from the 3rd to the 12th school years, reaching almost all pre-university years. The portuguese edition has been growing (~5K students in 2019, ~17K in 2020, ~43K in 2021, ~77K in 2022, over 105K from around 700 schools in 2023, ~135K from ~800 schools in 2024) and in 2025 we had ~150K students participating from around 800 schools from all over the country.

Ciber-Rato (Cyber-Mouse) Competition

In 2002, during my final BSc project, I decided to enter a different competition, dedicated to artificial intelligence. I participated in the Ciber-Rato (Cyber-Mouse) virtual robot contest, in which a software agent has to be very fast in solving a maze. I got the first place among teams from several institutions. In 2003 I won again and continued to participate until 2006 (albeith spending less and less time developing the agent), obtaining the 2nd place in 2005.

Contestant record

International Olympiads in Informatics (IOI)
1995Represented Portugal on IOI'1995, The Netherlands
1996Represented Portugal on IOI'1996, Hungary
1997Represented Portugal on IOI'1997, South Africa
1998Represented Portugal on IOI'1998, Portugal
National Olympiads in Informatics (ONI)
19952nd place at the national finals
19961st place at the national finals
19971st place at the national finals
19981st place at the national finals
Southwestern Europe Regional ACM ICPC Contest (SWERC)
1999 to 2003always the best portuguese team
20002nd place out of 24 teams from 4 countries
Maratona Inter-Universitária de Programação (MIUP)
20011st place out of 21 teams, FCUP, Porto
20021st place out of 33 teams, FCUL, Lisbon
20031st place out of 32 teams, Univ. Minho, Braga
University of Porto Programming Contest (CPUP)
20001st place out of 18 teams
20011st place out of 24 teams
20021st place out of 18 teams
20031st place out of 20 teams
National Logical and Functional Programming Contest (CENPLF)
20031st global place (open division) out of 15 teams (Univ. Évora)
20041st global place (open division) out of 17 teams (IST, Lisbon)
20051st global place (open division) out of 24 teams (ESTG, Bragança)
Ciber-Rato (Cyber-Mouse) virtual robot contest
20021st place out of 13 teams
20031st place out of 14 teams
20052nd place out of 10 teams

Problem discussion sessions

List of my problems

This is a list of some of my online available problems that were used on real programming competitions. I also contributed to many other contest problems (either on ideas, problem statement or solutions) and I have authored dozens of other problems used in several types of courses.

YearContestProblem
2016SWERC Passwords
2026MIUP Elevator Explorer
2026MIUP Exam Distancing
2025MIUP Make Photos Great Again
2025MIUP Road Directions
2023MIUP This is the Way
2022MIUP Climate Change
2019MIUP Space Invaders
2018MIUP Clocks
2017MIUP Magnetic Fields
2016MIUP Problem Setters
2015MIUP Concatenate, Son, Concatenate!
2014MIUP Team Formations
2013MIUP Boundaries
2012MIUP Flying Balloons
2011MIUP Lego Mosaics
2009MIUP Domino Trouble
2008MIUP School Garden
2007MIUP Spider-Pig
2006MIUP Round and Round Maze
2005MIUP Car Rallying (with Fernando Silva)
2004MIUP Walking Around Wisely (with Fernando Silva)
2008CPUP TV Audience
2008CPUP Overcrowded School
2008CPUP Counting pieces
2008CPUP Drawing Paper
2007CPUP Triangle World
2007CPUP Entering the Stadium
2007CPUP Reforestation Plan (with Fernando Silva)
2007CPUP Sudokube
2007CPUP Summing Numbers
2007CPUP Unattainable Numbers
2007CPUP Chomp
2006CPUP The Guessing Game
2006CPUP Kaprekar Numbers
2006CPUP Bridge Building
2006CPUP Lemmings Battle!
2005CPUP Master Mind Helper
2005CPUP Fibonaccimal Base
2005CPUP Tweedle Numbers
2005CPUP The Pieces of the Puzzle
2005CPUP Uno game
2004CPUP Jumping Champion
2004CPUP Dividing Land
2004CPUP Euro 2004
2004CPUP ASCII Mandelbrot
2009IEEEXtreme Maze Keys
2009IEEEXtreme Police Station
2009IEEEXtreme Proctoring
2009IEEEXtreme Xtrebble (with Pedro Guerreiro)
2008IEEEXtreme Road Construction
2013CIIC Transforming Words
2012CIIC Symmetries in the Mirror
2012CIIC Complicated Traffic
2018ONI Final Códigos Preguiçosos
2017ONI IOI Selection Sequências Complementares
2017ONI Qualification A Corrida (with Pedro Paredes)
2016ONI IOI Selection Regras Quadriculadas
2016ONI Final Números Sortudos
2016ONI Final No Fundo do Mar
2016ONI Qualification Caderno Quadriculado
2015ONI IOI Selection Padrões Geométricos
2015ONI IOI Selection À Procura de um Número
2015ONI Final Quase Capicuas
2015ONI Final Obras na Via Férrea
2015ONI Final Dois Tipos de Programadores
2015ONI Qualification Confusão Classificativa
2014ONI Final Tabuleiros Axadrezados
2014ONI Final Blocos Numéricos
2014ONI Qualification Cartas Colecionáveis
2014ONI Qualification Desenhando Quadrados
2013ONI Final Alice no País dos Primos
2013ONI Final Constelação Retangular
2013ONI Final Apagando Letras
2013ONI Qualification Frota Imperial
2012ONI Final Triângulos de Pascal
2012ONI Final Arranha-Céus
2012ONI Final Saltitando
2012ONI Qualification Cromos Repetidos
2012ONI Qualification Código Genético
2011ONI Final Pontos e Rectângulos
2011ONI Final Para Cima e Para Baixo
2011ONI Final Labirinto em Espiral
2011ONI Qualification Bakugans
2011ONI Qualification Para o Infinito e Mais Além
2010ONI Final Trinta e Três
2010ONI Final Publicidade via Satélite
2010ONI Final Nenúfares
2010ONI Qualification Uma Questão de Divisores
2010ONI Qualification Nuvem de Cinzas
2010ONI Qualification Pirâmide de Palavras
2009ONI Final Somas de Quadrados
2009ONI Final Escolas (with Pedro Guerreiro)
2009ONI Final Palavras para que te quero
2009ONI Qualification Dubai
2009ONI Qualification Pequenos Alfabetos
2009ONI Qualification Comprar Pixels
2008ONI Selection Camp Pirâmides (with Pedro Guerreiro)
2008ONI Selection Camp Faraó (with Pedro Guerreiro)
2008ONI Selection Camp Caravanas (with Pedro Guerreiro)
2008ONI Final Controle de Tráfego Aéreo
2008ONI Final Números Fáceis de Escrever
2008ONI Final Vigiando a Fronteira
2008ONI Qualification Indiana Jones e o Triângulo Perdido
2008ONI Qualification O Carteiro Paulo
2007ONI Selection Camp Primómetro
2007ONI Selection Camp Encontros no Metro
2007ONI Final Turismo Espacial
2007ONI Final Números Divertidos
2007ONI Final Planeta Arrakis
2007ONI Qualification Um-Dó-Li-Tá
2007ONI Qualification Números Olímpicos
2006ONI Selection Camp Magia com Espadas
2006ONI Selection Camp Ronda Nocturna
2006ONI Final Planeta Diagonal
2006ONI Qualification O Campeão dos Saltos
2005ONI Selection Camp Condomínio Ideal
2005ONI Selection Camp Sopa de Primos
2005ONI Final A máquina do Professor ONI
2005ONI Final Em busca dos enunciados perdidos
2005ONI Qualification Descobrindo Anagramas
2004ONI Final Em Busca dos Números Perdidos

Contests: SWERC Southwestern Europe Regional ACM ICPC Contest · MIUP Maratona Inter-Universitária de Programação (the portuguese ICPC contest) · CPUP University of Porto Programming Contest · IEEEXtreme IEEEXtreme Programming Contest · CIIC Ibero-American Informatics Contest · ONI National Olympiads in Informatics (problems in portuguese).