
思考
coldfresh
那我们开始吧
展开
-
Keep On Movin(HDU-5744)(优化过程)
Professor Zhang has kinds of characters and the quantity of the ii-th character is aiai. Professor Zhang wants to use all the characters build several palindromic strings. He also wants to maximize the原创 2017-05-07 13:03:55 · 357 阅读 · 0 评论 -
关于一些函数求前缀和的问题
1.设f(n)f(n)f(n)为n的因子的和,求: ∑i=1nf(i)∑i=1nf(i)\sum_{i=1}^nf(i) 其中n<1012n<1012nans=∑in∑jn[j|i]∗j=∑jnj∑in[j|i]=∑j=1n⌊nj⌋ans=∑in∑jn[j|i]∗j=∑jnj∑in[j|i]=∑j=1n⌊nj⌋ans=\sum_i^n\sum_j^n[j|i]*j\\=\sum_j...原创 2018-07-24 20:38:55 · 455 阅读 · 0 评论 -
Auxiliary Set HDU - 5927(思维题)
Given a rooted tree with n vertices, some of the vertices are important. An auxiliary set is a set containing vertices satisfying at least one of the two conditions: ∙It is an important vertex ∙...原创 2018-04-30 15:43:55 · 300 阅读 · 0 评论 -
余数之和 HYSBZ - 1257
给出正整数n和k,计算j(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的值 其中k mod i表示k除以i的余数。 例如j(5, 3)=3 mod 1 + 3 mod 2 + 3 mod 3 + 3 mod 4 + 3 mod 5=0+1+0+3+3=7 Input 输入仅一行,包含两个整数n, k。 1<=n ,k<=10^...原创 2018-03-20 21:47:53 · 342 阅读 · 0 评论 -
Hamiltonian Spanning Tree CodeForces - 618D (思维)
A group of n cities is connected by a network of roads. There is an undirected road between every pair of cities, so there are roads in total. It takes exactly y seconds to traverse any single road....原创 2018-03-29 23:03:04 · 250 阅读 · 0 评论 -
The Union of k-Segments CodeForces - 612D (思维)
You are given n segments on the coordinate axis Ox and the number k. The point is satisfied if it belongs to at least k segments. Find the smallest (by the number of segments) set of segments on the c...原创 2018-03-22 22:40:44 · 231 阅读 · 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原创 2017-11-19 18:30:36 · 441 阅读 · 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原创 2017-11-12 16:40:57 · 758 阅读 · 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原创 2017-11-12 16:33:42 · 512 阅读 · 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原创 2017-11-12 16:28:38 · 408 阅读 · 0 评论 -
Teacher Bo HDU - 5762 (思维)
Teacher BoBo is a geography teacher in the school.One day in his class,he marked NN points in the map,the ii-th point is at (Xi,Yi)(Xi,Yi).He wonders,whether there is a tetrad (A,B,C,D)(A<B,C<D,A≠CorB≠原创 2017-08-31 11:22:20 · 345 阅读 · 0 评论 -
Abandoned country HDU - 5723 (???)
An abandoned country has n(n≤100000)n(n≤100000) villages which are numbered from 1 to nn. Since abandoned for a long time, the roads need to be re-built. There are m(m≤1000000)m(m≤1000000) roads to be原创 2017-08-30 23:07:38 · 359 阅读 · 0 评论 -
TIANKENG’s restaurant HDU - 4883
TIANKENG manages a restaurant after graduating from ZCMU, and tens of thousands of customers come to have meal because of its delicious dishes. Today n groups of customers come to enjoy their meal, and原创 2017-06-09 13:20:20 · 298 阅读 · 0 评论 -
【POJ - 3263】Tallest Cow(技巧)
FJ’s N (1 ≤ N ≤ 10,000) cows conveniently indexed 1…N are standing in a line. Each cow has a positive integer height (which is a bit of secret). You are told only the height H (1 ≤ H ≤ 1,000,000) of t...原创 2019-03-05 13:54:48 · 222 阅读 · 0 评论