原创 Codeforces 295B Greg and Graph

Greg has a weighed directed graph, consisting of n vertices. In this graph any pair of distinct vertices has an edg

原创 Codeforces 547B Mike and Feet

Mike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. All of

原创 Codeforces 339C Xenia and Weights

C. Xenia and Weights time limit per test 2 seconds memory limit per test 256 megabytes input standard input ou

原创 Codeforces 448C Painting Fence

Bizon the Champion isn’t just attentive, he also is very hardworking. Bizon the Champion decided to paint his old f

原创 Codeforces 557C Arthur and Table

Arthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is

原创 Codeforces 527D Clique Problem

The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulat

原创 Codeforces 513B2 Permutations

You are given a permutation p of numbers 1, 2, …, n. Let’s define f(p) as the following sum: Find the lexicographic

原创 ZOJ 3505 Yet Another Set of Numbers

You are given yet another set of numbers. The numbers in this set obey these rules: Each number will start with a n

原创 Codeforces 592D Super M

D. Super M time limit per test 2 seconds memory limit per test 256 megabytes input standard input output stand

原创 HDU 1011 Starship Troopers

Problem Description You, the leader of Starship Troopers, are sent to destroy a base of the bugs. The base is buil

原创 POJ 3208 Apocalypse Someday

Description The number 666 is considered to be the occult “number of the beast” and is a well used number in all ma

原创 Codeforces 598E Chocolate Bar

You have a rectangular chocolate bar consisting of n × m single squares. You want to eat exactly k squares, so you

原创 Codeforces 558C Amr and Chemistry

Amr loves Chemistry, and specially doing experiments. He is preparing for a new interesting experiment. Amr has n d

原创 HDU 4003 Find Metal Mineral

Problem Description Humans have discovered a kind of new metal mineral on Mars which are distributed in point‐like

原创 Codeforces 489D Unbearable Controversy of Being

Tomash keeps wandering off and getting lost while he is walking along the streets of Berland. It’s no surprise! In