摘要:
A permutation of size n is an array of size n such that each integer from 1 to n occurs exactly once in this array. An inversion in a permutation p is 阅读全文
摘要:
All bus tickets in Berland have their numbers. A number consists of n digits (n is even). Only k decimal digits d1,d2,…,dk can be used to form ticket 阅读全文
摘要:
Vasya is preparing a contest, and now he has written a statement for an easy problem. The statement is a string of length n consisting of lowercase La 阅读全文
摘要:
题意:现在有包括了Bob在内的N个小朋友,M种游戏卡片,Bob可以和其他人交换卡片,除了Bob,每个人的交换原则都是只给出自己拥有大于1的卡片,接受自己没有的卡片。问他最多有多少不同的卡片。 N<=10; M<=25; 思路:最大流,卡片流向玩家表示Bob付出卡片,玩家流向卡片,边数玩家给Bob卡片 阅读全文
摘要:
We consider problems concerning the number of ways in which a number can be written as a sum. If the order of the terms in the sum is taken into accou 阅读全文
摘要:
The Wall has down and the King in the north has to send his soldiers to sentinel. The North can be regard as a undirected graph (not necessary to be c 阅读全文
摘要:
As everyone knows, bears love fish. But Mike is a strange bear; He hates fish! The even more strange thing about him is he has an infinite number of b 阅读全文
摘要:
You are running for a governor in a small city in Russia. You ran some polls and did some research, and for every person in the city you know whom he 阅读全文
摘要:
Mr. Kitayuta has just bought an undirected graph with n vertices and m edges. The vertices of the graph are numbered from 1 to n. Each edge, namely ed 阅读全文
摘要:
n players are going to play a rock-paper-scissors tournament. As you probably know, in a one-on-one match of rock-paper-scissors, two players choose t 阅读全文