ACM 外挂模板技巧篇...

# Codeforces 916 C. Jamie and Interesting Graph （构造）

Description Jamie has recently found undirected weighted graphs with the following properties very interesting: The graph is connected and contains exactly n vertices and m edges. All ed...

# Codeforces 913 C. Party Lemonade （思维）

Description A New Year party is not a New Year party without lemonade! As usual, you are expecting a lot of guests, and buying lemonade has already become a pleasant necessity. Your favorite sto...

# Codeforces 560 E. Gerald and Giant Chess （dp，组合数学）

Description Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we’ll just say that the game takes place on an h × w field, and it is painted in two colors, but no...

# Codeforces 892 B. Wrath （递推）

Description Hands that shed innocent blood! There are n guilty people in a line, the i-th of them holds a claw with length Li. The bell rings and every person kills some of people in front of hi...

# Codeforces 892 C. Pride （枚举）

Description You have an array a with length n, you can perform operations. Each operation is like this: choose two adjacent elements from a, say x and y, and replace one of them with gcd(x, y), where...

# Codeforces 892 D. Gluttony （思维）

Description You are given an array a with n distinct integers. Construct an array b by permuting a such that for every non-empty subset of indices S = {x1, x2, …, xk} (1 ≤ xi ≤ n, 0 < k < n) the sums...

# Codeforces 890 D. Boxes And Balls （哈夫曼）

Description Ivan has n different boxes. The first of them contains some balls of n different colors. Ivan wants to play a strange game. He wants to distribute the balls into boxes in such a way...

# Codeforces 890 D. Restoration of string （技巧）

Description A substring of some string is called the most frequent, if the number of its occurrences is not less than number of occurrences of any other substring. You are given a set of strings...

# Codeforces 890 C. Petya and Catacombs （贪心）

Description A very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, his exploration is just walking through the catacombs. Catacombs consist o...

# 51nod 1350 斐波那契表示 （数学）

Description 每一个正整数都可以表示为若干个斐波那契数的和，一个整数可能存在多种不同的表示方法，例如：14 = 13 + 1 = 8 + 5 + 1，其中13 + 1是最短的表示（只用了2个斐波那契数）。定义F(n) = n的最短表示中的数字个数，F(14) = 2，F(100) = 3（100 = 3 + 8 + 89），F(16) = 2（16 = 8 + 8 = 13 + 3）。...

# FZU 2214 Knapsack problem （超大容量背包）

Description Given a set of n items, each with a weight w[i] and a value v[i], determine a way to choose the items into a knapsack so that the total weight is less than or equal to a given limit B and...

# 51nod 1829 函数 （斯特林数）

Description 想知道f:A->B这个函数（其中|A|=n, |B|=m）的所有映射关系要使B的每个元素都要被A的一个元素覆盖到。 数字可能很大你只要输出方案数模1,000,000,007即可。  Input 一共一行两个数，n和m。（1<=n,m<=1,000,000)  Output 一共一行包含一个方案数。  Input示例2 2  Output示例2  思路原题...

# 51nod 1836 战忽局的手段 （期望）

Description 众所周知，有一个神秘的组织——战忽局，在暗中保护着我们。在局中任职的官员都有着极强的忽悠技巧，不只能用预言，还能用往事忽悠人。如今某外星间谍已经获得了战忽局曾经参与的n次事件的资料，局座发现了这件事，于是决定再次用忽悠来保证战忽局的安全。局座将发表m次演讲，每一天他都会从n事件中等概率地挑选一件混淆众人，由于局座每天很忙，不能把之前将的事件都记录下来，因此他可能会重复选择...

# ZOJ 3987 Numbers （贪心）

Description DreamGrid has a nonnegative integer nn. He would like to divide nn into mm nonnegative integers a1,a2,…,ama_1, a_2, \dots, a_m and minimizes their bitwise or (i.e. n=a1+a2+⋯+amn=a_1 + a_2...

# Codeforces 122 D. Lucky Transformation （规律）

Description Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 ar...

# Codeforces 122 C. Lucky Sum（分块）

Description Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 ar...

# HDU 1754 I Hate It （线段树，模板）

Description 很多学校流行一种比较的习惯。老师们很喜欢询问，从某某到某某当中，分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢，现在需要你做的是，就是按照老师的要求，写一个程序，模拟老师的询问。当然，老师有时候需要更新某位同学的成绩。  Input 本题目包含多组测试，请处理到文件结束。 在每个测试的第一行，有两个正整数 N 和 M ( 0Ou...

# Codeforces 877 B. Nikita and string （技巧）

Description One day Nikita found the string containing letters “a” and “b” only. Nikita thinks that string is beautiful if it can be cut into 3 strings (possibly empty) without changing the orde...

701条 共36页1 2 3 4 5 ... 下一页 尾页
个人资料
• 访问：335536次
• 积分：9727
• 等级：
• 排名：第2135名
• 原创：689篇
• 转载：12篇
• 译文：0篇
• 评论：83条
寻找 Qianqian 遇见 就是幸运

#### @Dreamwings 夢の彼方は千千首页 | 文章 | 友人·A | ACM | 留言 | 关于by ♥ imqxms

博客专栏
 那些年,我们一起追过的算法 文章：6篇 阅读：23271
欢迎关注 <千与梦随> 哦！
最新评论