自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(98)
  • 问答 (2)
  • 收藏
  • 关注

原创 32

23

2016-12-19 17:48:08 305

原创 java基础-使用Arrays管理数组排序,复制,查找,填充

//Array.copyOf(int a[]@1,int newLength@2);1是原数组2新数组的长度 //Array.copyOfRange(int a[]@1,int form@2,int to@3);1是原数组2复制开始的位置3复制结束的位置 //System.arraycopy(objiect src@1,int@2 srcPos@3,Object dest@4,int dest

2016-07-19 10:59:17 510

原创 lower_bound()&&upper_bound()得用法

lower_bound()在整个前闭后开区间查找

2014-11-13 17:30:52 599

原创 LA3942

#include#includeusing namespace std;const int mode = 20071027;const int maxn = 310000;char str[maxn];int dp[maxn];char a[110];struct node{ int next[26]; int f;} T[4000*100];int tot;

2014-09-04 10:27:41 554

原创 LA4329

N (3 N 20000) ping pong players live along a west-east street(consider the street as a line segment). Eachplayer has a unique skill rank. To improve their skill rank, they often compete with eac

2014-09-03 17:04:58 522

原创 c++函数模板,有默认参数的函数

#include using namespace std;template //template两个都行T max(T a,T b,T c){ if(b>a) a=b; if(c>a) a=c; return a;}int main(){ int i1=185,i2=-76,i3=567,i; double d1=56.87,d2=-90.

2014-08-25 15:38:11 806

原创 c++函数

1.内置函数inline

2014-08-25 15:15:09 405

原创 C++控制符,操纵符

dec   10进制hex   16oct

2014-08-25 14:45:04 1774

原创 c++class(类)

1初始c++类class

2014-08-25 10:07:54 955

原创 C文件

#include#define SIZE 10struct student_type{    char name[10];    int num;    int age;    char addr[15];}stud[SIZE];void save(){    FILE *fp;    int i;    if((fp=fopen("st

2014-08-24 18:56:51 589

原创 c枚举类型

//枚举变量声明enum  Weekday {sum,mon,tue,

2014-08-23 10:47:19 459

原创 共用体

//共用体变量//申明union data{    int i;    char ch;    double f;}a,b,c;union data a,b,c;union{    int i;    char ch;    double f;}a,b,c;//只能引用成员不能引用本身//初始化a={16};a

2014-08-23 09:09:43 535

原创 c指针

1  指向函数的指针int(*o

2014-08-22 10:54:24 476

原创 c动态内存分配

1.void *malloc(unsigned size int)int *p;p=(int *)malloc(n*

2014-08-22 10:45:28 509

原创 数字的输出

1.指定宽度和小数位数(%m.nf)m宽度n小数位数

2014-08-21 15:24:15 487

原创 c语言字符处处理函数

strcat——字符串连接函数strcat(

2014-08-21 15:20:57 770

原创 树状数组,二查索引树,BIT

//预处理//c[i]=a[i-lowbit(i)+1]+......a[i];for(int i=1;i<=n;i++) for(int j=i-lowbit(i)+1;j<=i;j++) c[i]+=a[j];//求和int sum(int x){ int ret=0; while(x>0) { ret+=c[x];

2014-08-21 15:03:46 522

原创 uva(10344)

#include #include#includeusing namespace std;int a[6],A[6],flag,vis[6],v[6];char b[]= {"*-+"},B[6];void dfs1(int cur){ int t; if(flag) return ; else if(cur==5) { t=A[0

2014-08-20 10:05:00 469

原创 uva146(排序)

http://vjudge.net/vjudge/problem/viewProblem.action?id=19158ID CodesTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back

2014-08-16 10:19:45 495

原创 子集生成

/*//方法一://思路:构造一个位向量visit,而不是直接构造子集A本身#includeusing namespace std; void fun(int *visit, int cur, int n){ if(cur == n+1) { for(int i = 1;i <= n;++ i) if(visit[i])

2014-08-15 11:02:44 435

原创 uva253

设两个正方体是 c1, c2, 保持 c1 不变,枚举 c1 的相邻的三个面,和 c2 的6个面依次对比,如果这个面和其中一个面相同,并且这两个面的对面也对应相同,那么就把 c2 的这两个面标记为字符 ‘0’ ,防止以后再次用到这两个面。如果对于 c1 的这三个面的其中一个面,在 c2 中找不到符合条件(即两个面相同并且对面也相同)的,就退出循环,说明这两个正方体不相同,否则,这两个正方体相同

2014-08-14 10:41:43 595

原创 poj1001(大数据)

这个问题是要请你求出 Rn 的精确值。在这里R是一个实数(0.0 Input每组测试资料一列,包含了R,n,R的位置为第1行到第6行,n的位置为第8行到第9行。Output输出 Rn 的精确值。前后方无作用的0不应该出现。Sample input95.123 120.4321 205.1234 156.7592 9

2014-08-11 15:12:40 633

翻译 uva10106

http://vjudge.net/problem/viewProblem.action?id=19531

2014-08-10 21:35:57 503

原创 字符—数字转换

atof(将字符串转换成浮点型数)atoi(将字符串转换成整型数)atol(将字符串转换成长整型数)strtod(将字符串转换成浮点数)strtol(将字符串转换成长整型数)strtoul(将字符串转换成无符号长整型数)toascii(将整型数转换成合法的ASCII 码字符)toupper(将小写字母转换成大写字母)tolower(将大写字母转换成小写字母)

2014-08-10 21:04:20 454

原创 uva10815

http://vjudge.net/problem/viewProblem.action?id=18649没有初始化#include #include#include#include#include#include#include#include#include#include#include#define INF (1<<28)using nam

2014-08-10 20:22:41 386

原创 poj1598(字符串处理)

#include #include#include#include#include#include#include#include#include#include#include#include#define INF 1<<28using namespace std;struct node{ int sum,no; char s[200];

2014-08-10 16:30:31 422

原创 hdu1166(线段树)

http://acm.hdu.edu.cn/showproblem.php?pid=1166敌兵布阵Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 43122    Accepted Submission(s): 18259

2014-08-06 21:17:40 405

原创 hdu1754(线段树)

http://acm.hdu.edu.cn/showproblem.php?pid=1754***重磅消息——[BestCoder Round #4]冠军将获得iPad Mini一部! 《BestCoder用户手册》下载I Hate ItTime Limit: 9000/3000 MS (Java/Others)    M

2014-08-06 21:13:17 400

原创 poj3624(线段树)

例题: POJ 3264 Balanced Lineup给定Q (1 ≤ Q ≤ 200,000)个数A1,A2… AQ,,多次求任一区间Ai– Aj中最大数和最小数的差。本题树节点结构:struct CNode{int L,R; //区间起点和终点int minV,maxV; //本区间里的最大最小值CNode * pLeft, * pRight;};

2014-08-06 17:14:04 483

原创 poj2255(二叉树重建)

http://poj.org/problem?id=2255#include #include#include#include#include#include#include#include#include#include#include#define INF 1<<30using namespace std;void bulid(i

2014-08-06 15:24:52 1979

原创 poj3321(树状数组)

http://poj.org/problem?id=3321There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing

2014-08-06 10:44:16 470

翻译 poj1037(dP+排列计数)

http://poj.org/problem?id=1037

2014-08-04 19:05:38 2225

原创 poj1088(dp)

http://poj.org/problem?id=1088

2014-08-04 17:16:07 438

原创 百炼(2755)dp

2755:神奇的口袋ViewSubmitStatisticsHintClarify总Time Limit: 10000ms Memory Limit: 65536kBDescription有一个神奇的口袋,总的容积是40,用这个口袋可以变出一些物品,这些物品的总体积必须是40。John现在有n个想要得到的物品,每个物品的体积分别是a1,a2……an。Jo

2014-08-04 10:52:16 601

原创 poj1458(最长公共子序列dp)

#include #include using namespace std;char sz1[1000];char sz2[1000];int maxLen[1000][1000];int main(){ while( cin >> sz1 >> sz2 ) { int length1 = strlen( sz1); int lengt

2014-08-04 10:20:43 561

原创 poj1330( 树的先跟遍历)

#include#include#include#include#includeusing namespace std;const int N=10010;vector a[N];int f[N],r[N];void DFS(int u,int dep){ r[u]=dep; for(vector::iterator it=a[u].begin()

2014-08-03 18:00:04 500

原创 poj2503(简单hash)

题目大意:

2014-08-03 15:42:15 468

原创 poj1459最大流

#include #include#include#include#include#include#include#include#include#include#include#define INF 1<<30using namespace std;int n,np,nc,m,s,t;int fa[102],q[104],f[104][104],c[104][104

2014-08-01 16:40:53 424

原创 ural1109(二分图模板)

点击打开链接

2014-08-01 16:11:37 574

原创 poj3125(优先队列数组实现)

#include#includeusing namespace std;const int maxn=100+5;int main(){ int loop; cin>>loop; while(loop--) { int n,m; cin>>n>>m; int st,ed,a[maxn];

2014-07-26 11:30:30 893

空空如也

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

TA关注的人

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