Subsequence
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3995 Accepted Submission(s): 1308
Problem Description
There is a sequenc...
分类:
其他好文 时间:
2014-05-15 06:47:40
阅读次数:
275
/*
* hdu AC Me
* date 2014/5/13
* state AC
*/
#include
#include
#include
#include
using namespace std;
const int MAXN=100001;
char Arr[MAXN];
int cnt[26];
int main()
{
//cout << "Hello wor...
分类:
其他好文 时间:
2014-05-15 06:16:24
阅读次数:
247
/*
* hdu How many prime numbers
* date 2014/5/13
* state AC
*/
#include
#include
#include
using namespace std;
bool isPrime(int x)
{
int sqr=sqrt(x*1.0);
for(int i=2;i<=sqr;i++)
{...
分类:
其他好文 时间:
2014-05-15 05:07:18
阅读次数:
261
Problem Description
电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。
某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。...
分类:
其他好文 时间:
2014-05-15 04:01:20
阅读次数:
284
Problem Description
The new semester begins! Different kinds of student societies are all trying to advertise themselves, by giving flyers to the students for introducing the society. However, due ...
分类:
其他好文 时间:
2014-05-15 03:57:24
阅读次数:
311
插头DP。
题目要求构造出K条回路的方案数,而且不能出现环套环。
Sol:通过增加标记为来记录形成的回路数,假如不形成环的话就是在形成新的环路,此时,两边的插头个数要为偶数。
#include
#include
#include
#include
using namespace std;
const int MAXD=15;
const int STATE=1000010;
const i...
分类:
其他好文 时间:
2014-05-15 03:53:23
阅读次数:
272
http://acm.hdu.edu.cn/showproblem.php?pid=4635
Strongly connected
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1381 Accepted Sub...
分类:
其他好文 时间:
2014-05-15 03:26:53
阅读次数:
248
#include
#include
#include
#include
#include
#include
using namespace std;
struct ssss
{
ssss *c[26];
int n,v;
}*s;
void insert(char *str,int v)
{
int i,j,k,l;
ssss *p,*q;
p=...
分类:
其他好文 时间:
2014-05-14 15:06:54
阅读次数:
357
/*
* hdu 最小公倍数
* date 2014/5/13
* state AC
*/
#include
using namespace std;
int gcd(int x,int y)
{
while(x!=y)
{
if(x>y)x=x-y;
else y=y-x;
}
return x;
}
int main()
...
分类:
其他好文 时间:
2014-05-14 14:29:59
阅读次数:
225