Problems for Beginners

Missing Number
Given the sum of four numbers and three of those numbers, find the missing number. All four numbers ...
Maximum
Given N numbers, find the one that is of the highest value and print it.
Mixed Fractions
Given an improper fraction (as the numerator $N$ and the denominator $D$), determine and print it in...
Math and Watermelons
Your friend has M watermelons. He doesn't want to share them with anyone, but let's imagine he would...
Is Palindrome
Given a word, print Yes if it is a palindrome, otherwise No. A palindrome is a word which reads the ...
Making Friends
Byang is going to join a new school. His new class has N students. Each of the students are identifi...
Is Anagram
An anagram is a word formed by rearranging the letters of another word. The words "listen" and "sile...
Is Prime
Given an integer $N$, determine if it is a prime a number. A number is called prime if it is only di...
Leap Years
In the Gregorian calendar, certain years have 366 days instead of 365. In such years, the month of F...
Incompatible Crops
Did you know that certain crops cannot grow next to each other? Given the layout of a field as a gri...
Little Subarray Sum
Given an array of N numbers and two indices, determine the sum of the numbers in the array between (...
Neat Brackets
Given a sequence of opening and closing parentheses ("(" and ")") you will have to determine if it i...
Little Matrix Multiplication
Given two 2×2 matrices, calculate the product of the two matrices. The product of two 2×2 matrices w...
ICPC Is Coming in Hot!
Tanmoy is an ACM ICPC contestant. During practice he came across a problem named ‘OWLLEN’. He has ha...
Mines
The game of mines is a tricky one. You start with a grid and you click your way through the cells to...
N-th Prime
In this problem, you will have to print the n-th prime number. The first few prime numbers are given...
Itsy's Magic Cards
Itsy needs your help with her magic cards. Her magic cards grant her special spider-witch powers. Un...
Goat Research
Goats are interesting creatures. They are incredibly durable and can fall from great heights, be str...
Matching Brackets
You will be given a sequence of opening and closing brackets of different types ((, ), [, ], {, and ...
Grid'y Rotations
Consider an M×N grid of numbers and then a series of (r,c) pairs. Each (r,c) pair corresponds to a p...
Itsy's Triangles
Itsy went for a walk and found several sticks in the park. She is wondering how many of these sticks...
Knapsack
You have a backpack that can carry a maximum weight of C. You will also be given a set of items, the...
One-dimensional
Imagine there are several lines in an one dimensional space. You are given the starting and ending p...
How Many X's?
Given a string with only X’s you have to print how many X’s there are.
Imagine a Graph 1
Imagine a graph of infinite nodes labelled with positive integers from 1 to ∞. Take every pair of no...
Toph uses cookies. By continuing you agree to our Cookie Policy.