随笔分类 - 动态规划 递推
摘要:MZL's Circle Zhou Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem Description MZL's Circle Zhou is good at
阅读全文
摘要:Killer Names Problem Description > Galen Marek, codenamed Starkiller, was a male Human apprentice of the Sith Lord Darth Vader. A powerful Force-user
阅读全文
摘要:Rikka with String Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to p
阅读全文
摘要:Classic Quotation Problem Description When online chatting, we can save what somebody said to form his ''Classic Quotation''. Little Q does this, too.
阅读全文
摘要:Problem 2200 cleaning Problem Description N个人围成一圈在讨论大扫除的事情,需要选出K个人。但是每个人与他距离为2的人存在矛盾,所以这K个人中任意两个人的距离不能为2,他们想知道共有多少种方法。 Input 第一行包含一个数T(T<=100),表示测试数据的
阅读全文
摘要:E. Liar The first semester ended. You know, after the end of the first semester the holidays begin. On holidays Noora decided to return to Vičkopolis.
阅读全文
摘要:题目链接:传送门 题意: n个学生站一行,老师给每个学生发至少一个糖 相邻学生,a[i] > a[i-1] 的话,那么右边学生的糖一定要发得比左边学生的糖多 问你满足条件这个老师总共最少的发多少糖 题解: 向左向右连续递增的话发的糖数量就递增,否则就是1个 取一个max即可
阅读全文
摘要:Christy is interning at HackerRank. One day she has to distribute some chocolates to her colleagues. She is biased towards her friends and may have di
阅读全文
摘要:度度熊最近对全排列特别感兴趣,对于1到n的一个排列,度度熊发现可以在中间根据大小关系插入合适的大于和小于符号(即 '>' 和 '<' )使其成为一个合法的不等式数列。但是现在度度熊手中只有k个小于符号即('<'')和n-k-1个大于符号(即'>'),度度熊想知道对于1至n任意的排列中有多少个排列可以
阅读全文
摘要:E :Partial Sum 每次取任意两个不同的前缀,取过之后不能再取,最多取M次 将前缀和排序,优先取最大,最小就行了 #include<bits/stdc++.h> using namespace std; #pragma comment(linker, "/STACK:102400000,1
阅读全文
摘要:B. 分词 B. 分词 有一句句子因为粘贴的时候出现了一点问题空格全部丢失了。现在给一本字典,每个词都对应这个词出现的频率(每十亿)。根据这个频率,我们可以根据下面的公式算出这个词带来的收益 P(word): P(word)=len2(word)⋅ln(frequency(word)) 其中 fre
阅读全文
摘要:题目链接:点这里 题意: 让你构造一个长度范围在[A,B]之间 字符串(大小写字母,数字),问你有多少种方案 需要满足条件一下: 1:构成串中至少包含一个数字,一个大写字母,一个小写字母; 2:不能包含给定的N个病毒串 3:遵循一堆映射规则 题解: 将病毒串建立AC自动机 设定dp[i][j] [0
阅读全文
摘要:C. Divide by Three A positive integer number n is written on a blackboard. It consists of not more than 105 digits. You have to transform it into a be
阅读全文
摘要:F. PolandBall and Gifts It's Christmas time! PolandBall and his friends will be giving themselves gifts. There are n Balls overall. Each Ball has some
阅读全文
摘要:题目链接:http://codeforces.com/contest/762/problem/D 多多分析状态;这个很明了
阅读全文
摘要:C. Mahmoud and a Message 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 wro
阅读全文
摘要:DNA repair Problem Description Biologists finally invent techniques of repairing DNA that contains segments causing kinds of inherited diseases. For t
阅读全文
摘要:2-3 Trees Problem Description 2-3 tree is an elegant data structure invented by John Hopcroft. It is designed to implement the same functionality as t
阅读全文
摘要:C. Logo Turtle A lot of people associate Logo programming language with turtle graphics. In this case the turtle moves along the straight line and acc
阅读全文
摘要:题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1104 题意: 有n个仓库(最多100个),m个管理员(最多30个),每个管理员有一个能力值P(
阅读全文