上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页

2014年3月26日

uva 11732 (trie树)

摘要: 题意:求N个字符串两两比较,共比较了多少次?#include#include#includeusing namespace std;typedef long long LL;const int maxnode = 4000 * 1000 + 10;// 字母表为全体小写字母的Triestruct Trie{ int head[maxnode]; // head[i]为第i个结点的左儿子编号 int next[maxnode]; // next[i]为第i个结点的右兄弟编号 char ch[maxnode]; // ch[i]为第i个结点上的字符 int tot[max... 阅读全文

posted @ 2014-03-26 17:56 雄.. 阅读(186) 评论(0) 推荐(0)

2014年3月24日

20140323组队赛 2012福建省第三届ACM省赛题目

摘要: A -Solve equationTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionYou are given two positive integers A and B in Base C. For the equation:A=k*B+dWe know there always existing many non-negative pairs (k, d) that satisfy the equation abov 阅读全文

posted @ 2014-03-24 14:26 雄.. 阅读(302) 评论(0) 推荐(0)

2014年3月18日

La 3942 字符串+dp

摘要: 题目大意:一个字符串,可以分解成若干英语单词的连接(单词可以重复使用),求有多少种方法?#include#include#include#includeusing namespace std;const int maxl=300005;const int maxwn=4005;const int maxwl=105;const int MOD=20071027;const int maxnode=400005;const int sigma_size=26;struct Trie{ int ch[maxnode][sigma_size]; int val[maxnode]; ... 阅读全文

posted @ 2014-03-18 20:54 雄.. 阅读(137) 评论(0) 推荐(0)

2014年3月14日

foj 2144 三位几何+区间覆盖

摘要: 题目大意:一个人站在三维坐标系下的原点处用炮打蚊子,给出n个蚊子的起始坐标跟单位时间匀速移动的方向向量,距离他R以内的蚊子都可以打到,不过他也需要休息,没蚊子的时候也可以休息下。求他要起来多少次打蚊子。#include #include #include #include using namespace std;const int N = 100005;const double eps = 1e-6;const double Pi=acos(-1.0);int n, cnt;double R;inline bool scan_d(double &ret){ //如果数据比较多,而输入的 阅读全文

posted @ 2014-03-14 19:09 雄.. 阅读(211) 评论(0) 推荐(0)

Foj 2148 二维几何(点是否在三角形内)

摘要: 题目大意:给n个坐标(不存在三点共线的点),求能够组成多少个凸四边形。#include#include#includeusing namespace std;struct Point{ int x,y; Point(int x=0,int y=0):x(x),y(y){}}p[35];typedef Point Vector;Vector operator - (Vector A, Vector B){ return Vector(A.x-B.x,A.y-B.y);}int AbsCross(Vector A,Vector B){ return fabs(A.x*B.y-A.y*B... 阅读全文

posted @ 2014-03-14 19:01 雄.. 阅读(202) 评论(0) 推荐(0)

foj 2150 bfs

摘要: 题意:给定一个平面图 . 为空地(不着火) # 为草开始可以选1-2个草堆点燃,每隔一秒会把上下左右的草引燃(开始时间为0秒)问把所有草烧光的最少时间#include#include#include#includeusing namespace std;const int INF=1000000000;inline int min(int a,int b){return ab?a:b;}char mp[15][15];int v[15][15];int R,C;int dir[4][2]={0,1,0,-1,1,0,-1,0};struct Node{ int x,y; Node(... 阅读全文

posted @ 2014-03-14 18:57 雄.. 阅读(153) 评论(0) 推荐(0)

2014年3月9日

poj 3468 线段树成段更新

摘要: A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KTotal Submissions:54012Accepted:16223Case Time Limit:2000MSDescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interv 阅读全文

posted @ 2014-03-09 17:25 雄.. 阅读(259) 评论(0) 推荐(0)

hdu 1698 线段树成段更新

摘要: #include#includeusing namespace std;#define lson left,mid,i0) { f[i>1; bulid(lson); bulid(rson); pushup(i); return ;}void update(int left,int right,int set,int i){ if(f[i].left==left && f[i].right==right) { f[i].set=set; f[i].sum=(right-left+1)*set; r... 阅读全文

posted @ 2014-03-09 16:47 雄.. 阅读(116) 评论(0) 推荐(0)

hdu 1754 线段树(点修改)

摘要: I Hate ItTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 31979Accepted Submission(s): 12649Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每 阅读全文

posted @ 2014-03-09 13:49 雄.. 阅读(341) 评论(0) 推荐(0)

2014年3月7日

hdu 2888 二维RMQ

摘要: Check CornersTime Limit: 2000/10000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1646Accepted Submission(s): 597Problem DescriptionPaul draw a big m*n matrix A last month, whose entries Ai,j are all integer numbers ( 1 #include#includeusing namespa... 阅读全文

posted @ 2014-03-07 15:38 雄.. 阅读(301) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页

导航