自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(55)
  • 资源 (1)
  • 收藏
  • 关注

转载 子集生成的两种方法

该算法来自--刘汝佳的算法竞赛入门经典。书中介绍了两种算法的核心代码,但却没有逐过程详细解说,另初学者看文字时很难看懂,遇到问题,是先要直接研究问题的细节呢还是先把问题搞清楚?我认为绝对应该先学习如何去解决问题,构造方法的框架,而不是先去研究细节。//方法一://思路:一次选出一个元素放到集合中[cpp] view plain copy #i

2017-05-12 18:22:38 349

原创 task_1_3_1

HTML task_1_3_1 团队名称 百度前端技术学院是一个为大学生创办的免费的前端技术实践、分享、交流平台。由百度校园招聘组、百度校园品牌部、百度前端技术部以及多个百度的前端团队联合创办。

2017-03-31 21:07:48 322

原创 task_1_2_1

html: task_1_1_1 导航链接一 导航链接二 导航链接三 导航链接四 文章一级标题 文章二级标题 文章作者 发表时间 这是一个很长的段落,这是一个很长的段落,这里有个粗体字

2017-03-22 00:14:11 248

原创 task_1_1_1

task_1_1_1 ul li{ list-style-type :disc ; } .photo { padding-left: 15px; } table{ border: thin solid black;

2017-03-19 00:00:11 195

原创 1156. Binary tree

DescriptionYour task is very simple: Given a binary tree, every node of which contains one upper case character (‘A’ to ‘Z’); you just need to print all characters of this tree in pre-order.

2016-11-10 00:03:06 260

原创 uva 133

#include#include#include#include using namespace std;int a[21];int main(){ int n,k,m; int temx=0,temy=0; while(cin>>n>>k>>m) { if(n==0&&k==0&&m==0) break; for(int i=0;i<

2016-08-14 15:19:12 168

原创 uva 101

#include#includeusing namespace std;vector pile[30]; vector tem;int n;void print(){ for(int i=0;i<n;i++) { printf("%d:",i); for(int j=0;j<pile[i].size();j++) {

2016-08-12 16:31:13 224

原创 uva 127

#include#include#include#include#include#includeusing namespace std;struct Card{    char face[2];    }card;vector > poc ;                                bool ismatch(struct

2016-08-05 21:52:55 193

原创 uva 152

#include#include#include#include#include#includeusing namespace std;struct poi{ double x;double y;double z; } point[5010];int minn[5010]={0};int dis(struct poi a,struct poi b){ double

2016-08-03 16:37:55 221

原创 uva 10474

#include#include#include#include#includeusing namespace std;int num[10010]={0};int cmp(int a,int b){ return a<b;}int main(){ int m,n,i,j,k; int t=0; while(scanf("%d%d",&m,&n)==2) { i

2016-08-03 15:48:19 180

原创 uva 10420

这道题网上用STL的map做比较多。但是我还是没有用哈哈哈。所以代码比较长。#include#include#includechar s[2001][80];char first_name[2001][80];char last[2001][80];char country[2001][80];char cou[2001][80];int num[2001];int

2016-08-02 23:49:15 216

原创 uva 340

题意下面这个博客讲得很清楚。http://blog.163.com/kakarrot@yeah/blog/static/12011592520106241155854/然后是我的代码:#include#include#includeint first[10000];int tem[10000];int other[10000];int main(){ int i

2016-08-02 16:55:14 306

原创 uva 10115

#include#include#includechar s1[100][100];char s2[100][100];char state[100];char tem[100];int main(){ int n; while(scanf("%d",&n)==1) { if(n==0) break; getchar(); int i; for( i=0;i

2016-08-01 15:38:37 256

原创 uva 644

#include#include#includechar s[200000][10];int cmp(const void * _a,const void *_b){ char * a=(char *) _a; char * b=(char *) _b; return strcmp(a,b);}int main(){ int i=0;int num=0; int ok=0

2016-07-28 00:12:11 295

原创 uva 10815 Andy's First Dictionary

#include#include#includechar word[1000001][201];int cmp_string(void * a,void *b){ char * ax=(char *)a; char * bx=(char *)b; return strcmp(ax,bx);}int main(){ char c;int i=0,j=0; while(1)

2016-07-27 14:57:25 160

原创 uva 10878

这题是磁带解码,后台好像就这一个测试样例。只要答案正确就可以过了。思路是,空格代表0,o代表1.组成八位二进制ascII码。注意输入一行输出一行。#include#include#includeusing namespace std;int main(){ string x; getline(cin,x); while(getline(cin,x)) { i

2016-07-25 22:06:51 184

原创 uva 409

#include#include#includechar key[21][50];char state[21][101];int k,e;int fun(char a[]){ int len=strlen(a); int count=0; int m=0; int i; char tem[101]; for( i=0;i<len;i++) { //把char t

2016-07-23 22:58:03 238

转载 uva 537

#include #include#include#include using namespace std;char state[1000];int main(){ int n; scanf("%d",&n); getchar(); for(int j=0;j<n;j++) { char a[3]={0}; int flag=-1; fgets(state,1

2016-07-23 14:01:46 211

转载 uva 10361

题目大意:读取字符串,每个测试例子有两行,第一行中有5个子串,中间用 ""分开。第二行有一个串,以“...”结尾。最后每个实例打印两行,第一行简单的把输入的第一行打印出来,只去掉 符号,第二行按照原来第二行的打印,并把三个点去掉,换成s4,s3,s2,s5。over此题写个函数读取s1~s5,getss()#include#includechar s1[101],s2[101],s

2016-07-21 17:09:02 204

原创 uva 10010

写这道题写了好久,我好菜。。最后还是参考了别人的代码。用常量表真的可以简化代码。#include#include#includeusing namespace std;int posx;int posy;int dx[]={1,-1,0, 0,-1,1, 1,-1};int dy[]={1,-1,1,-1, 0,0,-1, 1};char word_list[51][51];

2016-07-21 13:58:33 172

原创 uva 401 回文词

我的方法写得不好。所以只贴代码了。#include#includechar cha[21];char tem[21];int palind(char a[]){ char tem[21]; strcpy(tem,a); int len=strlen(a); int i,m=len-1; for(i=0;i<len;i++) { tem[i]=a[m--]; } i

2016-07-20 12:39:56 215

原创 算法竞赛入门经典chapter4:本章小结

编写一个 函数solve,给定浮点数a, b, c, d, e, f,求解方程组af + by = c, dx + ey = f;任务1:使用assert宏,让解不唯一时异常退出。#include#include#includedouble x=0,y=0;void solve(double a,double b,double c,double d,double e,dou

2016-07-15 21:15:51 336

原创 算法竞赛经典入门第三章习题

习题3-1 分数统计(stat)输入一些学生的分数,哪个分数出现的次数最多?如果有多个并列,从小到大输出。任务1:分数均不超过100的非负整数任务2:分数均不超过100的非负实数,但最多保留两位小数。这个类似单词统计词频,按字典序输出频率最高的那些。oj地址为: http://acm.dlut.edu.cn/problem.php?id=1132#include

2016-07-13 16:46:05 788

原创 分数化小数(decimal)完整版

题目:输入正整数a,b,c,输出a/b的小数形式,精确到小数点后c位。a,b 分析:这道题目保留位数要考虑进位,以及c=0的情况。修改了一下网上的代码。考虑了小数点的输出情况,以及保留0位小数的情况。#includeint num[101];int main(){ memset(num,0,sizeof(num)); int a,b,c; scanf("%d%d%d

2016-07-05 23:20:11 1116

原创 Sciliy 1007. To and Fro

ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionMo and Larry have devised a way of encrypting messages. They first decide secretly on the number ofcolumns and write the message (

2016-06-01 23:43:30 330

原创 Scily 1002

1002. Anti-prime SequencesConstraintsTime Limit: 3 secs, Memory Limit: 32 MB DescriptionGiven a sequence of consecutive integers n,n+1,n+2,...,m, an anti-prime sequence is a rearrangement of

2016-05-28 23:00:12 304

原创 Sicily 1001

1001. AlphacodeConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionAlice and Bob need to send secret messages to each other and are discussing ways to encode theirmessages: Alice:

2016-05-08 16:15:04 305

原创 用栈写的计算器

学习了栈后就用栈写了一个计算器,可以计算含有括号的表达式。但是没有写完对空格的处理,就是这个计算器无法处理数字间含有空格的格式错误。(不过应该不会很困难)最后用到了后缀表达式来计算。下面是代码:#include#include#include#includeusing namespace std;stack vals;stack ops;int compare(cha

2016-05-02 21:20:59 532

原创 1000. MyString Class

Description定义一个MyString类如下,该类有构造函数、拷贝构造函数、析构函数、成员函数和静态成员函数,有一个C字符串指针变量,还有一个静态成员变量numberOfObjects。请你完成类的实现。class MyString{public:    MyString(const char*);    MyString(int = 0, char =

2016-03-21 20:21:42 343

原创 插入排序

// 插入排序 #includeusing namespace std;int main(){ const int arraySize=10; int data[arraySize] ={34,56,4,10,77,51,93,30,5,50}; int insert; for(int next=1;next<arraySize;next++) { int move=ne

2016-03-20 22:29:39 182

原创 判断质数的方法小结

判断质数的方法有很多种,这里只记录两种效率较高的方法。方法一:for(int i=0;i*i<=n;i++){ if(n%i==0) cout<<"n不是质数";}cout方法二:for(int i=0;i<=sqrt(n);i++){ if(n%i==0) cout<<"n不是质数";}cout推荐使用方法二。注意要取等号。

2016-03-18 23:14:58 447

转载 C++用new和不用new创建类对象区别

一、new创建类对象与不new区别下面是一些关于new创建类对象特点:new创建类对象需要指针接收,一处初始化,多处使用 new创建类对象使用完需delete销毁 new创建对象直接使用堆空间,而局部不用new定义类对象则使用栈空间 new对象指针用途广泛,比如作为函数返回值、函数参数等 频繁调用场合并不适合new,就像new申请和释放内存一样 二、new创建类对象实例1、ne

2016-03-13 21:54:29 529

原创 B - Ministry

DescriptionMr. F. wants to get a document be signed by a minister. A minister signs a document only if it is approved by his ministry. The ministry is anM-floor building with floors numbered f

2016-02-08 17:19:21 248

原创 B - AntiCAPS

DescriptionThe blonde Angela has a new whim: internet chats. Of course, as any blonde, she writes her messages using the upper case. You are the moderator of Angela's favorite chat and you're fe

2016-02-07 20:55:42 235

原创 H - Taxi

DescriptionPetr likes going by taxi. For him, it is not only the pleasure of a fast and comfortable ride, but also the opportunity to bargain with the driver over the fare. The bargaining betwee

2016-02-07 19:57:01 351

原创 HDU1005

#include#include#include#include#include#includeusing namespace std;int m[50];int main(){ int a,b,n; m[1]=1; m[2]=1; while(cin>>a>>b>>n) { if(a==0&&b==0&&n==0) break; for(int i=3;i

2016-02-07 19:26:29 159

原创 HDU1007 求最短距离的点对

#include#include#include#includeusing namespace std;struct sys{ double x; double y;};sys num[100001],num1[100001],num2[100001];bool cmpy(sys dot1,sys dot2){ if(dot1.y==dot2.y) return do

2016-02-07 19:25:59 382

原创 贪吃蛇

想写一个贪吃蛇~先占个坑

2016-02-01 15:48:51 218

原创 HDU1006

#include#include#include#include#include#includeusing namespace std;double d;struct interval{ double left; double right;};interval solve(double a,double b){//解方程 //Angle<=v*t+a<=360-

2016-01-29 21:25:38 303

原创 HDU1004

#include#include#include#includeusing namespace std;int main(){ int t; while(cin>>t) { if(t==0) break; string color[1001]; for(int i=0;i<t;i++) { cin>>color[i]; } sort(colo

2016-01-28 18:59:14 285

锋利的jQuery第二版源码

锋利的jQuery第二版源码。《锋利的jQuery》是人民邮电出版社在2009年6年出版的一本书籍。本书循序渐进地对jQuery的各种函数和方法调用进行了介绍,读者可以系统地掌握jQuery的DOM操作、事件监听和动画、表单操作、AJAX以及插件方面等知识点,并结合每个章节后面的案例演示进行练习,达到掌握核心知识点的目的

2017-09-20

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除