Monthly Archives: January 2013

Solution to Problem 15 on ProjectEuler.net

The problem: ——- Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner. How many routes are there through a 2020 grid? ——- My Solution #include <stdio.h> int main(){   int i,j,x,y;   long long int mat[21][21];   i=0;   for (j=0;j<21;j++)     mat[i][j]=1;   j=0;   for (i=0;i<21;i++)     mat[i][j]=1;   for […]

CodeChef.com Easy Problem: Transform the Expression

He’s an interesting albeit relatively easy problem from CodeChef.com: ———- Reverse Polish Notation (RPN) is a mathematical notation where every operator follows all of its operands. For instance, to add three and four, one would write “3 4 +” rather than “3 + 4”. If there are multiple operations, the operator is given immediately after […]

CodeChef Easy Problem: Sums in a Triangle

Still practicing for Facebook Hacker Cup 2013. The problem below is a classic, although I wouldn’t necessarily classify it as “easy” as the guys from CodeChef did. Anyway here you go: ———- Let’s consider a triangle of numbers in which a number appears in the first line, two numbers appear in the second line, three […]

CodeChef Easy Problem: Odd

Still practicing for Facebook Hacker Cup 2013: ———- The captain of the ship TITANIC is a little …. off the track. He needs to select the crew for the ship. But everyone seems to be eligible. So to test their intelligence, he plays a game. The contestants have to stand in a line. They are […]