Codeforces 124A - The number of positions】的更多相关文章

题目链接:http://codeforces.com/problemset/problem/124/A Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing b…
Description The number of positions time limit per test: 0.5 second memory limit per test: 256 megabytes input: standard input output: standard output Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say…
Codeforces 55D Beautiful Number a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. Input The first line of the input contains the number of cases t (1 ≤ t ≤ 10). Each of the next t lines contains two…
Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing behind him. Find the number of different positions Pe…
A. The number of positions time limit per test 0.5 second memory limit per test 256 megabytes input standard input output standard output Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there a…
Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing behind him. Find the number of different positions Pe…
题目链接:http://codeforces.com/problemset/problem/40/E 妙啊... 因为已经确定的格子数目严格小于了$max(n,m)$,所以至少有一行或者一列是空着的,那么除了这一行或者这一列的格子,其余的格子随意填,只要满足了当且对应的行(列)的积是$-1$就好了,用组合数算一算就好了,剩下的空着的一行或者一列用于收尾,可以发现它当且仅有一种放法. 考虑无解:如果$n+m$为奇数,同时还要注意一下如果$n=1$,或者$m=1$的情况 #include<iostr…
D. Soldier and Number Game time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Two soldiers are playing a game. At the beginning first of them chooses a positive integer n and gives it to the seco…
把数位dp写成记忆化搜索的形式,方法很赞,代码量少了很多. 下面为转载内容:  a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits.    问一个区间内[l,r]有多少个Beautiful数字    范围9*10^18        数位统计问题,构造状态也挺难的,我想不出,我的思维局限在用递推去初始化状态,而这里的状态定义也比较难    跟pre的…
原文链接https://www.cnblogs.com/zhouzhendong/p/9074226.html 题目传送门 - Codeforces 980E 题意 $\rm Codeforces$ 真是个令人伤心的地方. 伤心的 $zzd$ 给你一个有 $n$ 个节点的树,编号为 $i$ 的节点权值为 $2^i$. 让你砍掉其中 $k$ 个节点,使得剩余的所有节点都连通,并最大化剩余节点的权值和.输出方案. $n\leq 10^6$ 题解 伤心的 $zzd$ 再一次来到了令人伤心的 $\rm…