自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

blaze_jack

不做无法实现的梦

  • 博客(32)
  • 资源 (4)
  • 收藏
  • 关注

原创 hdu 1811 Rank of Tetris(并查集+拓扑排序)

自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。 为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果两个人具有相同的Rating,那就按这几个人的RP从高到低来排。  终于,Lele要开

2017-09-29 21:34:43 221

原创 HDU 2647 Reward(拓扑排序)

Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewards.   The workers wil

2017-09-27 13:42:32 200

原创 Hdu 2094 产生冠军

有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。  球赛的规则如下:  如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。  如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。  根据这个规则,无需循环较量,或许就能确定冠军。你的任务就是面对一群比赛选手,在经过了若干场撕杀之后,确定是否已经实际上产生

2017-09-27 13:38:04 215

原创 HDU1285——确定比赛名次

有N个比赛队(1 Input输入有若干组,每组中的第一行为二个数N(1 Output给出一个符合要求的排名。输出时队伍号之间有空格,最后一名后面没有空格。  其他说明:符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前;输入数据保证是正确的,即输入数据确保一定能有一个符合要求的排名。  Sample Input 4 3 1 2 2 3 4 3 Samp

2017-09-27 13:34:08 162

原创 zoj 1610 Count the Colors (线段树区间覆盖)

Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones. Your task is counting the segments of different colors you can see at last.

2017-09-17 09:27:27 198

原创 (两种解法)hdu 1540 Tunnel Warfare (线段树区间合并)

During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Except t

2017-09-17 09:03:29 183

原创 hdu1698 Just a Hook (线段树区间修改)

In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length.  No

2017-09-17 08:57:39 250

原创 POJ 3468 A Simple Problem with Integers(线段树区间修改)

You have N integers, 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 interval. The other is to ask for th

2017-09-11 23:37:59 189

原创 hdu1754 -- I Hate It(单节点更新)

多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。  这让很多学生很反感。  不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处理到文件结束。  在每个测试的第一行,有两个正整数 N 和 M ( 0 学生ID编号分别从1编到N。  第二行包含

2017-09-10 21:39:39 197

原创 HDU 1042 N!(高精度计算阶乘)

题意: 就是求n的阶乘。 思路: 开一个数组模拟乘法运算即可。 #include #include #include #include #include using namespace std; const int mx = 41000; int a[mx]; int main (){ int n; while(scanf("%d",&n) != EOF){ memset(a,

2017-09-09 13:24:13 268

原创 uvalive 3027 Corporative Network(种类并查集)

题意: 题目就是要你输出各个点与根节点的距离。有两种指令 I a b,的意思:将b作为a的根节点,a和b之间的距离为|a-b|%1000。 E a, 的意思:求出a与根节点的距离。 思路: 并查集的变形,在压缩路径的时候顺便在更新一下与根节点的距离。 ps:记录与根节点的距离要再开一个数组,我在更新距离的时候还是写错了,太菜。 #include #include #include #

2017-09-09 13:21:00 202

原创 SPOJ - ESYRCRTN(找规律)

F(1)=1 F(2)=3 F(N)=F(N-1)-F(N-2) Now you are given N, you have to find the value of F(1)+F(2)+......+F(N) . Input Input starts with an integer T(1 Output For each test case, print the value. Ex

2017-09-09 13:08:21 231

原创 HDU1166:敌兵布阵(线段树单点更新)

第一次写线段树,一步步照着模板写的,在更新父节点的时候本来应该用 = ,结果写成 +=,找了好多遍没找到,最后还是别人指出来的错误。#include #include #include using namespace std; const int mx = 5e4+10; int node [mx<<2]; void build(int L, int R, int rt){ if(L == R

2017-09-09 13:05:47 201

原创 Rightmost Digit HDU - 1061 (快速幂裸题)

直接套快速幂模板 #include #include #include #include #include #include using namespace std; int powermod(int a,int b,int c){ int ans=1; a = a % c; while(b>0){ if(b%2) ans = (ans * a) %c; b = b/2; a

2017-09-07 13:22:15 231

原创 Codeforces 450B Jzzhu and Sequences(矩阵快速幂)

根据题目所给公式推导出base矩阵为1    1      -1   0,接下来就可以套用快速幂矩阵模板。 #include #include #include #include #include #include #define ll long long using namespace std; const int mo = 1e9 + 7; struct node{ ll m[2][2

2017-09-07 13:17:31 132

原创 HDU 2157 How many ways??(矩阵快速幂)

中文题就不说题意了,其中 i 到 j 经过k个点的所有方案就是两个邻接矩阵相乘k-1次之后的结果。 #include #include #include #include #include #include using namespace std; const int mo = 1000; int n,m; struct node{ int m[31][31]; node(){ mem

2017-09-07 13:13:35 165

原创 HDU 1905 Pseudoprime numbers(快速幂)

题意: a的p次方p取模等于a,且p不是素数,就输出yes; #include #include #include #include #include #define ll long long using namespace std; ll powermod(ll a,ll b,ll c){ ll ans=1; a = a % c; while(b>0){ if(b%2) ans =

2017-09-07 13:12:05 287

原创 HDU 1420 Prepared for New Acmer(快速幂裸题)

快速幂裸题,注意用ll,数据别溢出就可以。 #include #include #include #include #include #include #define ll long long using namespace std; int powermod(ll a,ll b,ll c){ ll ans=1; a = a % c; while(b>0){ if(b%2) ans =

2017-09-07 13:09:59 311

原创 HDU 5187 zhx's contest(快速幂乘法)

题意: 经过一番推导之后,简单来说就是求2^n - 2的值,要用到快速乘法。 #include #include #include #include #include #include using namespace std; #define ll long long ll powmul(ll a, ll b, ll c){ ll ans = 0; a = a % c; while(b

2017-09-07 13:08:11 221

原创 HDU - 4549 斐波那契数列 (费马小定理+快速幂矩阵)

题意: 你会发现a和b的指数变化就是斐波那契数列,再结合费马小定理,定理应用到这一题就是可以将(A^B)%mod = (A^(B % mod ) )% mod)。 注意:用 long long防止数据溢出,最后a,b相乘之后要再取一次模。 #include #include #include #include #include #include using namespace std; #d

2017-09-07 12:57:44 300

原创 POJ 3070 Fibonacci(快速幂矩阵)

题意: 求斐波那契数列,直接矩阵快速幂。#include #include #include #include #include #include using namespace std; struct node{ int m[2][2]; }ans,base; node cmp(node a, node b){ node te; for(int i = 0; i < 2; i++

2017-09-07 12:54:14 182

原创 UVa 10369 - Arctic Network(求最小生成树的第k大边)

题意: 给出各个站点的坐标,还有卫星的个数,两个卫星可以连接任意点,没有卫星的点就需要发射无线电波,求无线电波至少要有多少射程才能连接所有的点。  将求出的最少生成树的边进行排序,然后将卫星给边最长的点使用,就可以求出答案。 ps:提交的时候,G++打印double型要用%f,用%lf会打印出0。 .#include #include #include #include #incl

2017-09-04 21:15:55 271

原创 POJ 1287 Networking(最小生成树)

题意: 最小生成树裸题,直接模板。 #include #include #include #include #include #define MAX 0x3f3f3f3f #define mx 55 using namespace std; int ma[mx][mx],vis[mx],cost,dis[mx]; int n,m; void init(){ memset(dis, 63, s

2017-09-04 21:13:35 155

原创 POJ 1258 Agri-Net 【最小生成树入门题目】

题意; 给出各个点之间的距离,求最小生成树。krual和prim都可以。 #include #include #include #include #include #define mx 105 using namespace std; int fa[mx],sum; int n,ce; struct aa{ int x,y,qu; }ma[mx*mx]; //结构体数组开成2*mx大小

2017-09-04 21:09:49 208

原创 UVA11987:Almost Union-Find (并查集的删除)

题意: 三个指令分别为:1:合并p,q所在的两个集合;   2:将p移动到q的集合中。   3:查询p所在集合的元素个数和元素之和。 难点在于第二个指令,不能简单的合并,因为p有可能是根节点。 所以再开一个id数组,记录p的编号。 #include #include #include #include #include #define mx 100010 using namespace

2017-09-04 21:02:26 235

原创 CodeForces - 233B - Non-square Equation(不小心会爆int)

思路: x2 + s(x)·x - n = 0,把这个方程配方一下,可以求出x的表达式。 int x=sqrt(n+s*s/4)-s/2;因为s最多81,所以可以直接枚举所有x,再进行验证。 #include #include #include #include #include #define mx 1000000000 using namespace std; long lon

2017-09-04 15:41:59 246

原创 POJ2492 -A Bug's Life(种类并查集)

题意: 跟食物链那题差不多,不过更简单。寻找是否存在同性恋的虫子。 用r[i]表示跟i与根节点的关系,1表示不同性别,0表示同性。每次只要检查r[a]与r[b]是否相等就可以。 ps:自己脑抽突然在判断r[a]和r[b]的时候写了个选择语句,无情wa多次,wa到怀疑人生。 #include #include #include #include #include #include using

2017-09-02 16:57:36 252

原创 POJ 1679 The Unique MST (prim判断最小生成树是否唯一)

思路: 在prim算法中,假设有a,b,c三个点。当更新加入c点时,若ac和bc的权值都为最小值,说明最小生成树不唯一。 理由很简单,当存在两个最小权值时,abc和acb都是最小生成树。 #include #include #include #include #include #include using namespace std; const int N=105; #define inf

2017-09-01 23:31:30 1034 1

原创 HDU 1875 畅通工程再续 (最小生成树)

题意: 注意把距离小于10米和距离大于1000的两个岛的距离设置为无穷大,调用prim函数结束后检查一下图是否连通即可。 #include #include #include #include #include #include using namespace std; const int N=105; #define inf 0x3f3f3f3f int n,vis[N]; double d

2017-09-01 23:22:06 178

原创 HDU 1233 还是畅通工程(prim)

题意: 求最小生成树,注意未给距离的点之间的距离要设置为无穷大。 #include #include #include #include #include #include using namespace std; const int N=105; #define inf 0x3f3f3f3f int ma[N][N],vis[N],dis[N],cost; int n; void prim(

2017-09-01 23:16:45 176

原创 HDU 1102 Constructing Roads(prim求最小生成树)

题意: 给出各个点的之间的距离,用最少的路将这些点连通起来。 思路:题目其实就是求最小生成树,我用了prim。那些已经连通的点将距离设置为0。#include #include #include #include #include #include using namespace std; const int N=105; #define inf 0x3f3f3f3f int ma[N

2017-09-01 23:12:01 188

原创 POJ2502 subway(spfa)

题意: 给出多条地铁的路线以及人和车的速度,求起点到终点的最短时间(可以在任意站点上下车)。 思路: 关键在于人和车速度不同的处理,因为人走路比地铁慢,所以在输入地铁站点的时候,就可计算出每两个站点之间花费的时间,不会影响到后面的松弛操作。 之后spfa就可以求出答案。 #include #include #include #include #include #include using

2017-09-01 22:58:24 243

AutoItLibrary-1.1_x64.rar

AutoItLibrary-1.1_x64.rar ,可以安装windows64位操作系统下,亲测有效。

2019-06-16

Linux大作业 web服务器

这是一个Linux的大作业实验报告,里面包含了web服务器源码和20页的实验报告。web服务器在Linux下以c语言实现,html作为页面展示,实现了get和post方法。实验报告包含了系统需求分析,系统设计,系统实现,系统测试等内容。

2019-02-10

oracle大作业--网上订餐系统(基于oracle和C#实现)

这是一份oracle的大作业实验报告,里面有源代码以及实验报告。实验报告有20页,包含了整个项目的需求分析,界面实现,核心代码,数据库设计,功能演示等方面。项目是以网上订餐系统为需求,C#为用户界面,Oracle为后台数据库。

2019-02-10

空空如也

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

TA关注的人

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