Kinds of Fuwas Time Limit: 2 Seconds      Memory Limit: 65536 KB In the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China as well as becoming a festival for people all over the world. The official ma…
G - Kinds of Fuwas Time Limit:2000MS    Memory Limit:65536KB    64bit IO Format:%lld & %llu SubmitStatusPracticeZOJ 2975 Description In the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China as well a…
K - Kinds of Fuwas Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Description In the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China as well as becoming a festival for p…
任意门:https://nanti.jisuanke.com/t/20750 J - LOL 5 friends play LOL together . Every one should BAN one character and PICK one character . The enemy should BAN 55 characters and PICK 55 characters . All these 2020 heroes must be different . Every one c…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5048 Sample Input 4 3 Sample Output 3 题目大意:n个格子排成一条直线,可以选择涂成红色或蓝色,问最少 m 个连续为红色的方案数. 分析:递推法 dp[i] 表示前 i 个最少 m 个连续为红色的方案数. 转移时,分类讨论: 1.前 i-1 个已经满足这个性质,那么,第 i 个随意涂色,方案数为 dp[i-1] * 2 . 2.前 i…
题目说每个相同文件(01串)都被撕裂成两部分,要求拼凑成原来的样子,如果有多种可能输出一种. 我标题写着排列组合,其实不是什么高深的数学题,只要把最长的那几个和最短的那几个凑一起,然后去用其他几个验证就行了,反正我的验证是非常暴力的,看起来...(其实加了个二维数组判定不是很吃复杂度) 代码: #include <string> #include <cstring> #include <stdio.h> #include <algorithm> #inclu…
---恢复内容开始--- Hearthstone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1102    Accepted Submission(s): 544 Problem Description Hearthstone is an online collectible card game from Blizzard Ente…
1005: [HNOI2008]明明的烦恼 Description 自从明明学了树的结构,就对奇怪的树产生了兴趣......给出标号为1到N的点,以及某些点最终的度数,允许在任意两点间连线,可产生多少棵度数满足要求的树? Input 第一行为N(0 < N < = 1000),接下来N行,第i+1行给出第i个节点的度数Di,如果对度数不要求,则输入-1 Output 一个整数,表示不同的满足要求的树的个数,无解输出0 Sample Input 3 1 -1 -1 Sample Output 2…
编码问题 题意就是a,b,c.....ab.....编码,给你一个字符串,输出这是第几个: 这里可以用暴力枚举,但也可以用组合数学的高超知识: 既然这样我就说一下排列组合的方法,如果要弄一个 各位数字递增的三位数,只需要在一个有序数列里面取三个数字,此时就无需关注顺序,因为顺序只能是升序的.比如0 1 2 3 4 5 6 7 8 9.取得9 5 8 那么他的顺序就只能是589.总数就是C(x,y),x代表位数,y代表可供选择的数的长度, 就像例子中是c(3,10).对于字母排列,道理也是一样.只…
T1 X国的军队 贪心,按$b-a$的大小降序排序,然后就贪心吧 #include<iostream> #include<cstdio> #include<algorithm> #define ll long long using namespace std; struct node { ll a,b,las; }h[]; ll T,n,ans; ll read() { ll aa=,bb=;char cc=getchar(); ;cc=getchar();} +cc-…