We are focused on algorithms and more theoretical approach to things.
Are you competitors in Competitive Programming contests?
Not everybody. Some of us prefer to solve problems “offline”, without the competitive part.
Who can join?
This society is open to every student at the University of Glasgow. It doesn’t matter if you are an experienced programmer, an expert competitive coder or are just learning your first language, feel free to come along.
How can I join?
We’ve got a Facebook group where you can read our latest news. Sometimes we meet physically so don’t miss any update!
In its essence, competitive programming is like solving math problems or puzzles, but instead of finding the solution yourself, you have to write a program which will find particular solutions on its own. It could be described as programming puzzle solving, the puzzles are usually referred to as problems. While these problems are fun to solve on their own, trying to write a solution that is better than your friend’s is where the fun comes in for some people, hence competitive programming.
What kind of problems?
For example, consider a sequence of numbers like this:
1, 2, 5, 7, 9, 85
(You may suppose all the numbers are natural).
What is the least number of elements we have to change so that each term (except the first) is equal to the preceding term plus 2?
We can see that 2 is the answer since 1, *3*, 5, 7, 9, *11* has the desired properties and it is not possible to do any better.
So now the fun bit, how could a program solve this problem for any given sequence?
And once you have solved it ask yourself: what if I choose a different approach? What are the limitations of my solution?
Competitive programming is all about asking yourself about the optimality of your solution. For example, if the number of elements was way greater than 6 would your algorithm still run fast?
Do we have to compete?
Not at all.
You can just solve the problems on your own or compare solutions with others in a “non-competitive” manner. With its close links to theoretical computer science as well as programming, it is a fun way to to acquire many transferable skills. Even if competing is not your thing, keeping in touch with other people interested in competitive programming can help you find interesting problems to solve.
But if competing does appeal to you, there are many opportunities to take part in various contests. It’s a rewarding and instructive experience regardless of the score you achieve.
Is Competitive Programming all about algorithms?
Yes and no. Many problems require classical algorithms you are not expected to come up with alone (especially during a competition). However for the majority of time you should come up with good ideas on top of existing “simple” techniques, not just memorize classic algorithms.
Let’s see another problem.
You are given a sequence of N positive integers. You are asked to find a permutation (reordering) of that sequence such that the maximum sum of two consecutive integers is minimized. N can be up to 106 and the code should run within a second.
For example, an optimal solution for the sequence 4, 5, 9, 3, 11 is 11, 3, 9, 5, 4 because among 11+3, 3+9, 9+5, 5+4 14 (11+3) is the least maximum sum possible and there is no way to improve that result.
The problem may seem difficult at first until you realize that sorting the elements is crucial. By sorting them we get 3, 4, 5, 9, 11. You can then realise that the maximum and the minimum elements have to be together because that way their sum is minimized, and that next to the minimum it is convenient to put the second maximum (second largest value) etc. So, first 11 (maximum), then 3 (minimum), 9 (second maximum) and so on.
Take your time to convince yourself that it works.
Let’s look again at the solution. We took for granted a fast sorting algorithm (many programming languages provide a very fast one) and built our observations and solution on top of that. The bottom line is: while learning good algorithms can give you a slight advantage, recycling ideas turns out be super effective in the majority of cases.
Are there other good reasons to do competitive programming?
You will develop a different perspective of your favourite programming language or languages;
You will acquire maths and algorithmic skills, which can be quite handy in an exam;
Job recruiters may ask you to solve competitive programming problems;
Just to have some fun
Wow, that’s cool, I am interested. Where do I start?
We are currently writing a page that explains the basic steps of competitive programming, however you can just Google “how to begin competitive programming” or “competitive programming problems” and start reading.
If you are keen to get started, we will be organising qualifications for Google HashCode and Google CodeJam. Details will be posted on our Facebook page.
Our news will be published firstly on our Facebook page. If you want to know about them without logging in to Facebook, you can still use this small tool.
It seems you enable the antitracking protection on your browser. Great, I do too; however now I can't tell you the news... So, why not simply disabling it for just this website
while we work on a way to fix that? Thanks for understanding.
Hurry up! The deadline for registration is on 17th October 2018.
are an university undergraduate
can code in Python, C, C++ or Java
are interested in algorithms and/or maths
feel competitive or just want to have fun
Then ICPC is for you!
What is it??
ICPC stands for International Collegiate Programming Contest and is a worldwide coding competition. It is open to any undergraduate university anywhere in the world. It is probably the most famous Competitive Programming competition, alongside the International Olympiad in Informatics (IOI).
Teams of 3 students try to solve as many problems as possible withing the given time limit. The first round will be hosted in Glasgow (as well as in many other places throughout the world).
Want to join?
Great! Here’s the procedure.
Find people who may want to be your dream team. Struggling to find them? Read the next section.