关闭

Mahmoud and a Message CodeForces - 766C (dp)

Mahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes strings. He wrote it on a magical paper but he was surprised because some characters disapp...
阅读(7) 评论(0)

Godsend CodeForces - 841B

Leha somehow found an array consisting of n integers. Looking at it, he came up with a task. Two players play the game on the array. Players move one by one. The first player can choose for his move a...
阅读(15) 评论(0)

Leha and Function CodeForces - 841C (greedy)

Leha like all kinds of strange things. Recently he liked the function F(n, k). Consider all possible k-element subsets of the set [1, 2, …, n]. For subset find minimal element in it. F(n, k) — mathemat...
阅读(48) 评论(0)

Maximum Subsequence CodeForces - 888E (二分+状压)

You are given an array a consisting of n integers, and additionally an integer m. You have to choose some sequence of indices b1, b2, …, bk (1 ≤ b1 < b2 < … < bk ≤ n) in such a way that the value of i...
阅读(116) 评论(0)

Almost Identity Permutations CodeForces - 888D (错排公式)

A permutation p of size n is an array such that every integer from 1 to n occurs exactly once in this array.Let’s call a permutation an almost identity permutation iff there exist at least n - k indice...
阅读(125) 评论(0)

K-Dominant Character CodeForces - 888C

You are given a string s consisting of lowercase Latin letters. Character c is called k-dominant iff each substring of s with length at least k contains this character c.You have to find minimum k such...
阅读(65) 评论(0)

Short Program CodeForces - 878A

Petya learned a new programming language CALPAS. A program in this language always takes one non-negative integer and returns one non-negative integer as well.In the language, there are only three comm...
阅读(34) 评论(0)

Being a Hero HDU - 3251 (最小割)

You are the hero who saved your country. As promised, the king will give you some cities of the country, and you can choose which ones to own! But don’t get too excited. The cities you take should NOT...
阅读(28) 评论(0)

Game HDU - 3657(还是算最小割吧)

onmylove has invented a game on n × m grids. There is one positive integer on each grid. Now you can take the numbers from the grids to make your final score as high as possible. The way to get score i...
阅读(24) 评论(0)

方格取数(2) HDU - 1569(二分图最大点权独立集)

给你一个m*n的格子的棋盘,每个格子里面有一个非负数。 从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取数所在的2个格子不能相邻,并且取出的数的和最大。 Input 包括多个测试实例,每个测试实例包括2整数m,n和m*n个非负数(m<=50,n<=50) Output 对于每个测试实例,输出可能取得的最大的和 Sample Input 3 3 75 15 21...
阅读(30) 评论(0)

方格取数(1) HDU - 1565(状压dp)

给你一个n*n的格子的棋盘,每个格子里面有一个非负数。 从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。 Input 包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n<=20) Output 对于每个测试实例,输出可能取得的最大的和 Sample Input 3 75 15 21 75 15...
阅读(22) 评论(0)

Thieves HDU - 3491(最小点割集)

In the kingdom of Henryy, there are N (2 <= N <= 100) cities, with M (M <= 10000) two-direct ways connecting them. A group of thieves from abroad plan to steal the metropolitan museum in city H (It h...
阅读(19) 评论(0)

King of Destruction HDU - 3002(全局最小割)

Zhou xingxing is the successor of one style of kung fu called “Karate Kid”.he is falling love with a beautiful judo student,after being humiliated by her boyfriend,a Taekwando master from Japan,Zhou is...
阅读(14) 评论(0)

A new Graph Game HDU - 3435 (二分匹配思想)(最小花费最大流)

传送门 题目同上 史上速度最快ac#include #include #include #include #include using namespace std; const int maxn=2005;//点的最大上线 const int maxx=44005;//边的最大上线 const int INF=1<...
阅读(34) 评论(0)

Tour HDU - 3488(带权二分匹配)(最小花费最大流)

In the kingdom of Henryy, there are N (2 <= N <= 200) cities, with M (M <= 30000) one-way roads connecting them. You are lucky enough to have a chance to have a tour in the kingdom. The route should be...
阅读(37) 评论(0)
174条 共12页1 2 3 4 5 ... 下一页 尾页
    个人资料
    • 访问:15544次
    • 积分:1805
    • 等级:
    • 排名:千里之外
    • 原创:174篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条