hdu 5056Boring count】的更多相关文章

题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=5056 题目大意:就是问在子串中每一个小写字母出现次数不超过k次的个数,注意子串是连续的子串.. . . 思路: code: <span style="font-size:18px;">#include<cstdio> #include<iostream> #include<cmath> #include<cstring> #in…
Count the string Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 8845    Accepted Submission(s): 4104 Problem Description It is well known that AekdyCoin is good at string problems as well as n…
Count primes 题目连接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5901 Description Easy question! Calculate how many primes between [1...n]! Input Each line contain one integer n(1 <= n <= 1e11).Process to end of file. Output For each case, output…
It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example:  s: "abab"  The prefixes are: "a", "ab&…
题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6470 Count Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 301    Accepted Submission(s): 127 Problem Description Farmer John有n头奶牛.某天奶牛想要数一数有多少头奶牛…
Count the Buildings Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2521    Accepted Submission(s): 817 Problem Description There are N buildings standing in a straight line in the City, numbere…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6016 题意:给定男羊和女羊的朋友关系,即给定一个图,问从任意一只羊开始连续数四只不相同的羊的方法数. 这题挺简单的就是需要动一下脑子,我们只要找到关系A-B-C-D即可,且关系址建立在男女羊之间. 就是说我们只要找到 男羊-女羊-男羊-女羊,或者 女羊-男羊-女羊-男羊 即可. 于是那只要找到任意一种方式的总数然后乘2即可. 拿后一种关系为例. ans[i]表示i号女羊有几个男羊朋友vc[i]存储与…
hdu5901题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5901 code vs 3223题目链接:http://codevs.cn/problem/3223/ 思路:主要是用了一个Meisell-Lehmer算法模板,复杂度O(n^(2/3)).讲道理,我不是很懂(瞎说什么大实话....),下面输出请自己改 #include<bits/stdc++.h> using namespace std; typedef long long LL;…
for the backtracking part, thanks to the video of stanford cs106b lecture 10 by Julie Zelenski for the nice explanation of recursion and backtracking, highly recommended. in hdu 2553 cout N-Queens solutions problem, dfs is used. // please ignore, bel…
Count a * b Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 211    Accepted Submission(s): 116 Problem Description Marry likes to count the number of ways to choose two non-negative integers a…