Live2d Test Env

随笔分类 -  DP

摘要:描述 程序员常常需要给变量命名、给函数命名、给项目命名、给团队命名…… 好的名字可以大大提高程序员的主观能动性,所以很多程序员在起名时都会陷入纠结和烦恼。 小Hi希望给新的项目起个拉风的名字。他希望这个名字可以包含N个关键字,并且总长度最短。例如包含关键字abcd、cdab和dabc的最短字符串是c 阅读全文
posted @ 2018-02-17 23:18 nimphy 阅读(210) 评论(2) 推荐(0)
摘要:数学期望 P=Σ每一种状态*对应的概率。 因为不可能枚举完所有的状态,有时也不可能枚举完,比如抛硬币,有可能一直是正面,etc。在没有接触数学期望时看到数学期望的题可能会觉得很阔怕(因为我高中就是这么认为的,对不起何老板了QwQ),避之不及。 但是现在发现大多数题就是手动找公式或者DP推出即可,只要 阅读全文
posted @ 2018-01-01 08:55 nimphy 阅读(23971) 评论(3) 推荐(15)
摘要:描述 小Ho面前有N个小球排成了一排。每个小球可以被染成M种颜色之一。 为了增强视觉效果,小Ho希望不存在连续K个或者K个以上的小球颜色一样。 你能帮小Ho计算出一共有多少种不同的染色方法么? 例如N=4, M=2, K=3,则有10种染色方法: 0010 0011 0100 0101 0110 1 阅读全文
posted @ 2017-12-27 17:19 nimphy 阅读(486) 评论(0) 推荐(0)
摘要:Organizing a programming contest is not an easy job. To avoid making the problems too difficult, the organizer usually expect the contest result satis 阅读全文
posted @ 2017-12-26 16:39 nimphy 阅读(400) 评论(0) 推荐(0)
摘要:There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and wants to 阅读全文
posted @ 2017-12-24 21:08 nimphy 阅读(488) 评论(0) 推荐(0)
摘要:King Arthur is an narcissist who intends to spare no coins to celebrate his coming K-th birthday. The luxurious celebration will start on his birthday 阅读全文
posted @ 2017-12-17 13:40 nimphy 阅读(446) 评论(1) 推荐(0)
摘要:495. Kids and Prizes Time limit per test: 0.25 second(s) Memory limit: 262144 kilobytes input: standard output: standard ICPC (International Cardboard 阅读全文
posted @ 2017-12-15 22:39 nimphy 阅读(940) 评论(1) 推荐(0)
摘要:The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains to watch fairies dancing i 阅读全文
posted @ 2017-12-15 21:31 nimphy 阅读(489) 评论(0) 推荐(0)
摘要:BuggyD loves to carry his favorite die around. Perhaps you wonder why it's his favorite? Well, his die is magical and can be transformed into an N-sid 阅读全文
posted @ 2017-12-15 14:12 nimphy 阅读(2085) 评论(2) 推荐(2)
摘要:In 0th day, there are n-1 people and 1 bloodsucker. Every day, two and only two of them meet. Nothing will happen if they are of the same species, tha 阅读全文
posted @ 2017-12-15 10:52 nimphy 阅读(704) 评论(0) 推荐(0)
摘要:Akemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl). Homura wants to help her friend Madoka save the world. But because of the plot of the Boss 阅读全文
posted @ 2017-12-14 20:53 nimphy 阅读(766) 评论(1) 推荐(2)
摘要:When wake up, lxhgww find himself in a huge maze. The maze consisted by N rooms and tunnels connecting these rooms. Each pair of rooms is connected by 阅读全文
posted @ 2017-12-14 20:17 nimphy 阅读(778) 评论(0) 推荐(1)
摘要:Background If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and t 阅读全文
posted @ 2017-12-14 15:45 nimphy 阅读(895) 评论(4) 推荐(1)
摘要:Time limit per test: 2.0 seconds Memory limit: 512 megabytes Time limit per test: 2.0 seconds Memory limit: 512 megabytes Time limit per test: 2.0 sec 阅读全文
posted @ 2017-12-09 13:05 nimphy 阅读(535) 评论(8) 推荐(0)
摘要:问题: Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets 阅读全文
posted @ 2017-12-08 12:21 nimphy 阅读(224) 评论(0) 推荐(0)
摘要:时间限制:24000ms 单点时限:3000ms 内存限制:256MB 时间限制:24000ms 单点时限:3000ms 内存限制:256MB 描述 给定 n 和 k。计算有多少长度为 k 的数组 a1, a2, ..., ak,(0≤ai) 满足: a1 + a2 + ... + ak = n。 阅读全文
posted @ 2017-12-05 11:11 nimphy 阅读(374) 评论(0) 推荐(0)
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Given a directed graph containing n vertice (numbered from 1 to n) and m edges. Can you tell us how many differ 阅读全文
posted @ 2017-12-03 21:53 nimphy 阅读(268) 评论(0) 推荐(1)
摘要:问题: Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where h 阅读全文
posted @ 2017-12-03 19:51 nimphy 阅读(588) 评论(0) 推荐(0)
摘要:问题 Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atom 阅读全文
posted @ 2017-12-03 16:24 nimphy 阅读(383) 评论(0) 推荐(0)
摘要:问题 The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hir 阅读全文
posted @ 2017-12-03 15:24 nimphy 阅读(252) 评论(0) 推荐(0)