随笔分类 - 计数
摘要:求有胜利的情况: 定义dp[i][j],i个人,生命在j内,最后剩1个人的情况 每次每个人损失i-1点生命值,枚举死亡人数k,这些人生命值小于i dp[i][j] += dp[i-k][j-(i-1)]*(i-1)k*Cik 死亡人数有 k 个,我们要从i个人中选出 k 个人来死亡 死亡的人中,因为
阅读全文
摘要:k-Tree 对dp数情况的问题还是不太懂 #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include <map> #inc
阅读全文
摘要:1286A - Garland 玄学特判+贪心 #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include <map> #i
阅读全文
摘要:You wrote down all integers from 00 to 10n−110n−1, padding them with leading zeroes so their lengths are exactly nn. For example, if n=3n=3 then you w
阅读全文
摘要:Like any unknown mathematician, Yuri has favourite numbers: AA, BB, CC, and DD, where A≤B≤C≤DA≤B≤C≤D. Yuri also likes triangles and once he thought: h
阅读全文
摘要:The only difference between easy and hard versions is constraints. You are given a sequence aa consisting of nn positive integers. Let's define a thre
阅读全文
摘要:Karl likes Codeforces and subsequences. He wants to find a string of lowercase English letters that contains at least kk subsequences codeforces. Out
阅读全文
摘要:Problem Statement There is a grid with HH horizontal rows and WW vertical columns. Let (i,j)(i,j) denote the square at the ii-th row from the top and
阅读全文
摘要:Suppose there is a h×wh×w grid consisting of empty or full cells. Let's make some definitions: riri is the number of consecutive full cells connected
阅读全文
摘要:Alice got many presents these days. So she decided to pack them into boxes and send them to her friends. There are nn kinds of presents. Presents of o
阅读全文
摘要:Recently Ivan the Fool decided to become smarter and study the probability theory. He thinks that he understands the subject fairly well, and so he be
阅读全文
摘要:Vasya will fancy any number as long as it is an integer power of two. Petya, on the other hand, is very conservative and only likes a single integer p
阅读全文
摘要:Time Limit: 2 sec / Memory Limit: 1024 MB Score : 300300 points Problem Statement Given are positive integers NN, MM, QQ, and QQ quadruples of integer
阅读全文
摘要:Your company was appointed to lay new asphalt on the highway of length nn. You know that every day you can either repair one unit of the highway (lay
阅读全文
摘要:Bessie the cow has just intercepted a text that Farmer John sent to Burger Queen! However, Bessie is sure that there is a secret message hidden inside
阅读全文
摘要:output standard output You are given a tree consisting of nn nodes. You want to write some labels on the tree's edges such that the following conditio
阅读全文
摘要:Dreamoon likes sequences very much. So he created a problem about the sequence that you can't find in OEIS: You are given two integers d,md,m, find th
阅读全文
摘要:You are given two integers aa and bb, and qq queries. The ii-th query consists of two numbers lili and riri, and the answer to it is the number of int
阅读全文
摘要:Santa Claus has received letters from nn different kids throughout this year. Of course, each kid wants to get some presents from Santa: in particular
阅读全文
摘要:We start with a string ss consisting only of the digits 11, 22, or 33. The length of ss is denoted by |s||s|. For each ii from 11 to |s||s|, the ii-th
阅读全文

浙公网安备 33010602011771号