装饰模式的英文原文是:Attach additional responsibilitities to an object dynamically keeping the same interface. Decorators provide a flexible alternative to subclassing for extending functionality. 意思是:动态的给一个对象添...
分类:
其他好文 时间:
2015-04-21 09:49:37
阅读次数:
191
简单的字典树题,首先简历字典树,在查找。
#include
using namespace std;
struct Tri
{
int v;
Tri* child[26];
} root;
void Init()
{
root.v=0;
for(int i=0;i<26;i++)
{
root.child[i]=NULL;
}
}
void CreateDic(ch...
分类:
其他好文 时间:
2015-04-21 09:46:41
阅读次数:
122
【每日一歌】今天给大家推荐的是Groove Coverage(舞动精灵王族)的一首经典老歌-《she》。Groove Coverage在中国最出名的歌曲莫过于God Is A Girl,Far
Away From Home,She。他们的歌曲早已耳熟能详,这首《She》即使在9年后的今天聆听,依然能给你的耳朵带来舒缓愉悦的极致享受。
“她”,是谁?——她性感迷人,她自由...
分类:
其他好文 时间:
2015-04-21 09:49:05
阅读次数:
202
Hamming Code
Time Limit: 1000MS
Memory Limit: 65536KB
64bit IO Format: %I64d & %I64u
Submit Status
Description
Let us consider four disks intersecting as in the fig...
分类:
其他好文 时间:
2015-04-21 09:45:52
阅读次数:
159
题意:有一个烧烤机,每次最多能烤 m 块肉,现在有 n 个人来买烤肉,每个人到达时间为 si,离开时间为 ei,点的烤肉数量为 ci,每个烤肉所需烘烤时间为 di,注意一个烤肉可以切成几份来烤。
思路:这一题和hdu 3572 Task Schedule有一点点像,但这一题时间的范围跨度太大,不能再每个时刻看成一个点了,要进行缩点,这一点很巧妙,我没想到。将所有的到达时间和结束时间按升序排序,得到 x <= 2n-1 个时间区间。建立网络流模型:s为源,t为汇,每个顾客i作为一个结点并连边(s, i, ni...
分类:
其他好文 时间:
2015-04-21 09:46:05
阅读次数:
132
游戏人生
时间限制:1000 ms | 内存限制:65535 KB
难度:2
描述
一入宿舍深似海,自此AC是路人,善哉善哉。。。
有这样一个游戏:有一排妖怪,每个妖怪都有一个主要攻击值和辅助攻击值,你每次只能攻击一个妖怪,当你攻击一个妖怪时,这只妖怪 很显然的就挂了(要不都没得玩儿了),当然当前妖怪对你造成的伤害为 当前妖怪的主要攻击值+旁边两只妖怪的...
分类:
其他好文 时间:
2015-04-21 09:45:05
阅读次数:
130
uva 11008 Antimatter Ray ClearcuttingIt’s year 2465, and you are the Chief Engineer for Glorified Lumberjacks Inc. on planet Trie. There is a number of trees that you need to cut down, and the only wea...
分类:
其他好文 时间:
2015-04-21 09:45:12
阅读次数:
194
题目传送:UVA - 10192
思路:就是简单的最长公共子序列啦,不过输入居然还包含空格,然后很奇怪的TLE了,不是WA,心想n最大才100居然TLE,,好吧,可能有些数据特殊吧
AC代码:
#include
#include
#include
using namespace std;
char s1[105], s2[105];
int dp[10...
分类:
其他好文 时间:
2015-04-21 09:46:30
阅读次数:
196
“青软杯”安徽科技学院第六届程序设计大赛_专业组...
分类:
其他好文 时间:
2015-04-21 09:46:58
阅读次数:
335
1.题目描述:点击打开链接
2.解题思路:本题要求找在区间[L,R]中素因子只有一个且自身不是素数的数,这实际上就是找素因子的幂次大于1的数在该区间中有几个。可以利用前缀和的思想,用cal(k)表示不超过k的这样的数有几个,那么最终的答案就是cal(R)-cal(L-1)。而cal()函数可以通过逐一尝试素数计算最大幂次来得到。当p>sqrt(k)时即可停止枚举。
注意要用long long输...
分类:
其他好文 时间:
2015-04-21 09:44:51
阅读次数:
137
Tray 2
Time Limit: 1000MS
Memory Limit: 65536KB
64bit IO Format: %I64d & %I64u
Submit Status
Description
One of the organizers of the Ural Regional School Programmi...
分类:
其他好文 时间:
2015-04-21 09:44:26
阅读次数:
163
Masterpieces of World Architecture
Time Limit: 1000MS
Memory Limit: 65536KB
64bit IO Format: %I64d & %I64u
Submit Status
Description
Maria Ivanovna informed all of...
分类:
其他好文 时间:
2015-04-21 09:44:37
阅读次数:
105
Amusement Park
Time Limit: 1000MS
Memory Limit: 65536KB
64bit IO Format: %I64d & %I64u
Submit Status#include
using namespace std;
int a[10];
void init()
{
a[0] = 10;
a[1] =...
分类:
其他好文 时间:
2015-04-21 09:44:15
阅读次数:
130
ElevatorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 50245 Accepted Submission(s): 27678Problem Description
The highest building in our...
分类:
其他好文 时间:
2015-04-21 09:44:58
阅读次数:
108
Minefield
Time Limit: 500MS
Memory Limit: 65536KB
64bit IO Format: %I64d & %I64u
Submit Status
Description
To fulfill an assignment, a reconnaissance group of n peo...
分类:
其他好文 时间:
2015-04-21 09:45:08
阅读次数:
129
Don’t Ignore That Error!Pete GoodliffeI was walking down the street one evening to meet some friends in a bar. We hadn’t shared a beer in some time, and I was looking forward to seeing them again. In m...
分类:
其他好文 时间:
2015-04-21 09:43:51
阅读次数:
170
Don’t Just Learn the Language, Understand Its CultureAnders NoråsiN HiGH SCHOOL, i HAD TO LEARN A FOREiGN LANGUAGE. At the time, I thought that I’d get by nicely being good at English, so I chose to sl...
分类:
其他好文 时间:
2015-04-21 09:43:12
阅读次数:
128