Codeforces355-div2B Vanya and Food Processor

Problem - B - Codeforces

Vanya smashes potato in a vertical food processor. At each moment of time the height of the potato in the processor doesn't exceed h and the processor smashes k centimeters of potato each second. If there are less than k centimeters remaining, than during this second processor smashes all the remaining potato.

Read on →
Jun 2nd, 2016

SRM691 D2M Sunnygraphs2

TopCoder Statistics - Problem Statement

Hero has just constructed a very specific graph. He started with n isolated vertices, labeled 0 through n-1. For each vertex i Hero then chose a vertex a[i] (other than i) and he added an edge that connected i and a[i]. This way he created a graph with n vertices and n edges.

Read on →
May 31st, 2016

SRM691 D2E PlusoneGame

TopCoder Statistics - Problem Statement

Hero plays a game with a deck of cards and a counter. Initially, the counter is set to zero. During the game Hero must play each card in the deck exactly once. He gets to choose the order in which he plays the cards. You are given the description of the deck in the String s.

Read on →
May 31st, 2016

AOJ2383 Rabbit Game Playing

Rabbit Game Playing | Aizu Online Judge

Introduction to Programming Introduction to Algorithms and Data Structures Library of Data Structures Library of Graph Algorithms Library of Computational Geometry Library of Dynamic Programming Library of Number Theory

Read on →
May 30th, 2016

AOJ2176 for the Peace

For the Peace

This is a story of a world somewhere far from the earth. In this world, the land is parted into a number of countries ruled by empires. This world is not very peaceful: they have been involved in army race. They are competing in production of missiles in particular.

Read on →
May 29th, 2016

AOJ2299 Tiles Are Colorful

Tiles are Colorful | Aizu Online Judge

Introduction to Programming Introduction to Algorithms and Data Structures Library of Data Structures Library of Graph Algorithms Library of Computational Geometry Library of Dynamic Programming Library of Number Theory

Read on →
May 28th, 2016

Codeforces354-div2D Theseus and Labyrinth

Problem - D - Codeforces

Theseus has just arrived to Crete to fight Minotaur. He found a labyrinth that has a form of a rectangular field of size and consists of blocks of size 1 × 1. Each block of the labyrinth has a button that rotates all blocks 90 degrees clockwise.

Read on →
May 26th, 2016

Codeforces354-div2C Vasya and String

Problem - C - Codeforces

High school student Vasya got a string of length n as a birthday present. This string consists of letters 'a' and '' only. Vasya denotes beauty of the string as the maximum length of a substring (consecutive subsequence) consisting of equal letters. Vasya can change no more than k characters of the original string.

Read on →
May 26th, 2016

Codeforces354-div2B Pyramid of Glasses

Problem - B - Codeforces

Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is n.

Read on →

AOJ2320 Infinity Maze

Infinity Maze

Dr. Fukuoka has placed a simple robot in a two-dimensional maze. It moves within the maze and never goes out of the maze as there is no exit. The maze is made up of H × W grid cells as depicted below. The upper side of the maze faces north.

Read on →
May 22nd, 2016