- 博客(18)
- 收藏
- 关注
原创 UVa1593 Alignment of Code
Alignment of Code UVA - 1593 只给出题目链接;题意:输入若干代码,要求各列单词的左边界对齐并且尽量靠左。单词之间至少要空一格。每个单词不超过80字符,每行不超过180字符,一共最多1000行,样例如下:Sample Input start: integer; // begins herestop:
2017-08-19 10:17:28
249
原创 HDU6143 Killer Names
Killer Names HDU - 6143 取名字,名和字都有n个字母,并且由m个字母中取,要求名和字不能出现同一个字母。ans=C1m∗1n∗(m−1)n+C2m∗(2n−C12∗1)∗(m−2)n+... 代码如下:#includeusing namespace std;typedef long long LL;cons
2017-08-18 11:05:32
279
原创 快速幂 O(logn)
typedef long long LL; LL poww(LL a,LL b){ LL r=1,base=a; while(b){ if(b&1) r*=base; base*=base; b>>=1; } return r;}假设我们要求a^b,那么其实b是可以拆成二进制的,该二进制数第i位的权为2^(i-1),例如当b
2017-08-18 10:17:58
382
原创 HDU1164 Eddy's research I
Eddy's research ITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10342 Accepted Submission(s): 6386Problem DescriptionEddy's
2017-08-17 11:15:02
294
原创 ZOJ1056 The Worm Turns
The Worm TurnsTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluDescriptionWorm is an old computer game. There are many versions, but all involve maneuvering a
2017-08-17 11:07:38
296
转载 母函数模板
在数学中,某个序列的母函数(Generating function,又称生成函数)是一种形式幂级数,其每一项的系数可以提供关于这个序列的信息。使用母函数解决问题的方法称为母函数方法。母函数可分为很多种,包括普通母函数、指数母函数、L级数、贝尔级数和狄利克雷级数。对每个序列都可以写出以上每个类型的一个母函数。构造母函数的目的一般是为了解决某个特定的问题,因此选用何种母函数视乎序列本身的特性和
2017-08-17 11:05:48
193
原创 HUD1028 Ignatius and the Princess III
Ignatius and the Princess IIITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22033 Accepted Submission(s): 15385Problem Descripti
2017-08-17 11:02:12
229
原创 HUD2056 Rectangles
RectanglesTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24963 Accepted Submission(s): 8116Problem DescriptionGiven two rect
2017-08-17 10:50:17
313
原创 HDU2051 Bitset
Bitset Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23901 Accepted Submission(s): 17756Problem DescriptionGive you a n
2017-08-17 10:45:46
247
原创 求字符串的重复子字符串的最小周期
/*周期串 求多组字符串的最小周期 如qwqwqwqw 最小周期为2 by小战*/#include#includeusing namespace std;int main(){ char s[100]; while(cin >> s) { int len = strlen(s); for(int i=1;i<len;i++) { if(!(len%i)
2017-08-17 10:35:41
1263
1
原创 Election
F(1967): ElectionSubmit Page Summary Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 495 Solved: 44 DescriptionAfter all the fundraising, campaigning and
2017-08-17 10:32:00
735
原创 abc:def:ghi=1:2:3问题
用1,2,3……,9组成3个三位数abc,def和ghi,每个数字恰好使用一次,要求abc:def:ghi=1:2:3.输出所有解。
2017-08-17 10:29:07
1172
原创 01背包—HDU2546饭卡
饭卡Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32456 Accepted Submission(s): 11216Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,
2017-08-17 09:51:51
201
原创 c++模板
#includeusing namespace std;template struct Point { T x,y; Point(T x = 0,T y = 0):x(x),y(y) {}};template Point operator + (const Point& A, const Point& B) { return Point(A.x+B.x,B.y+A.y);}
2017-07-31 21:13:19
150
原创 思路Word Amalgamation
Word AmalgamationTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionIn millions of newspapers across the United States there is a wor
2017-07-31 19:37:29
257
转载 解析程序的健壮性和鲁棒性
一、健壮性健壮性是指软件对于规范要求以外的输入情况的处理能力。所谓健壮的系统是指对于规范要求以外的输入能够判断出这个输入不符合规范要求,并能有合理的处理方式。另外健壮性有时也和容错性,可移植性,正确性有交叉的地方。比如,一个软件可以从错误的输入推断出正确合理的输入,这属于容错性量度标准,但是也可以认为这个软件是健壮的。一个软件可以正确地运行在不同环境下,则认
2017-07-21 16:58:27
691
转载 sscanf函数和正则表达式
此文所有的实验都是基于下面的程序: char str[10]; for (int i = 0; i 执行完后str的值为 str = "!!!!!!!!!!" 我们把str的每个字符都初始化为惊叹号,当str的值发生变化时,使用printf打印str的值,对比先前的惊叹号,这样就可以方便的观察str发生了怎样的变化。下面我们做几个小实验,看看使用sscanf
2017-07-18 16:21:46
181
原创 [NOIP]正整数的表示
题目描述任何一个正整数都可以用2的幂次方表示。例如:137=27+23+20同时约定方次用括号来表示,即ab 可表示为a(b)。由此可知,137可表示为:2(7)+2(3)+2(0)进一步:7= 22+2+20 (21用2表示) 3=2+20 所以最后137可表示为:2(2(2)+2+2(0))+2(2+2(0))+2
2017-05-28 16:57:43
696
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人