tf girl

路漫漫其修远兮,吾将上下而求索。

导航

2014年8月7日 #

HDU1711 【kmp算法 基础题】

摘要: #include#includeint next[10005],lena,lenb;int a[1000005],b[10005];void set_naxt()//子串的next数组{ int i=0,j=-1; next[0]=-1; while(i<lenb) { ... 阅读全文

posted @ 2014-08-07 16:23 tf girl 阅读(156) 评论(0) 推荐(0) 编辑

2014年7月30日 #

有向无环图(DAG)模型之-----嵌套矩阵(与猴子与香蕉很像)

摘要: 一、题目 有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a#include#includeusing namespace std;struct rectangle{ int a; int b;}q[1002];bool cmp(stru... 阅读全文

posted @ 2014-07-30 12:38 tf girl 阅读(316) 评论(0) 推荐(0) 编辑

2014年7月27日 #

关于 C/C++左移右移运算符 的总结

摘要: 一、概述本文是根据整合网上资料与相关博文总结出来的关于【C/C++左移右移运算符 】的知识。二、正文(1)结合图示篇,更加简单明了。移位运算包含“逻辑移位”(logical shift)和“算术移位”(arithmetic shift)。逻辑移位:移出去的位丢弃,空缺位(vacant bit)用 0... 阅读全文

posted @ 2014-07-27 17:20 tf girl 阅读(13228) 评论(0) 推荐(0) 编辑

acm集训训练赛(二)D题【并查集】

摘要: 一、题目DescriptionThere is a town with N citizens. It is known that some pairs of people are friends. According to the famous saying that “The friends of... 阅读全文

posted @ 2014-07-27 16:38 tf girl 阅读(226) 评论(0) 推荐(0) 编辑

acm集训训练赛A题【签到题】

摘要: 一、题目DescriptionAfter winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a grid made ofnhori... 阅读全文

posted @ 2014-07-27 16:08 tf girl 阅读(638) 评论(0) 推荐(0) 编辑

acm集训训练赛B题【排序+模拟】

摘要: 一、原题DescriptionBeing a programmer, you like arrays a lot. For your birthday, your friends have given you an arrayaconsisting ofndistinctintegers.Unfor... 阅读全文

posted @ 2014-07-27 15:19 tf girl 阅读(328) 评论(1) 推荐(0) 编辑

2014年7月23日 #

ZOJ1093 Monkey and Banana 【DP】

摘要: 一、题目ZOJ 1093二、题目源程序#include //一个箱子有3种h..所以总共有3*n种高度.按面积从大到小排序#include struct block{ int x,y,z,h;}a[200];int cmp(const void *a,const void *b)//快排,模版{ r... 阅读全文

posted @ 2014-07-23 16:28 tf girl 阅读(186) 评论(0) 推荐(0) 编辑

2014年7月22日 #

POJ1061 青蛙的约会

摘要: 一、题目POJ 1061 青蛙的约会【关于“欧几里得求最大公约数”和“扩展欧几里得算法”的题目】二、题目源程序#include using namespace std;#define LL long longLL gcd(LL a, LL b){ return b ? gcd(b, a%b)... 阅读全文

posted @ 2014-07-22 17:04 tf girl 阅读(180) 评论(0) 推荐(0) 编辑

2014年7月21日 #

归并排序习题1

摘要: 一、题目给定一组数5,2,4,6,1,3,2,6;运用归并排序法对这组数进行排序。二、题目源程序#include#includeint L[100],R[100];void merge(int numbers[],int left, int mid, int right) { ... 阅读全文

posted @ 2014-07-21 15:45 tf girl 阅读(459) 评论(0) 推荐(0) 编辑

2014年7月19日 #

第一次集训个人赛 T1(签到题)

摘要: 一、题目DescriptionWangpeng is good at drawing. Now he wants to say numbers like “521” to his girlfriend through the game draw something.Wangpeng can’t wr... 阅读全文

posted @ 2014-07-19 16:05 tf girl 阅读(280) 评论(0) 推荐(0) 编辑