自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

蓦然回首

梦想遥远,道阻且长。

  • 博客(41)
  • 资源 (18)
  • 收藏
  • 关注

原创 HLG-2186 铺地砖

题目链接:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=2186 类似于斐波那契问题,当确定前几组的情况(容易漏,样例给的还好),后面的方案数具有一定规律。#include <iostream>#include <stdio.h>using namespace std;int main(){

2016-08-30 21:36:04 549

原创 HDU-5038 Grade (2014亚洲区北京站网络赛)

题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5038 给出N个0-200之间的数,以100为轴每个书对应一个函数值,如果所有的函数值出现的频率都相等而自变量不相等输出Bad Mushroom,否则输出频率最高的函数值,若有多个升序输出。#include<iostream>#include<cstdio>#include<cstrin

2016-08-28 15:03:21 425

原创 HDU-5037 Frog(2014亚洲区北京站网络赛)

题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5037 M长的数轴,N个石头,青蛙每次跳动距离为L,求问跳到终点最多多少步#include<stdio.h>#include<cmath>#include<algorithm>#include<iostream>#include<string.h>typedef long long

2016-08-28 14:55:56 390

原创 HDU-5035 Delivery(2014亚洲区北京站网络赛)

题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5035 求概率期望,运用到积分变换,多为概率论中知识,化简后与ci无关#include <iostream>#include <stdio.h>using namespace std;int main(){ int n,m,k; scanf("%d",&m);

2016-08-28 13:41:07 472

原创 HDU--3549 Flow Problem 网络流

http://acm.split.hdu.edu.cn/showproblem.php?pid=3549 题目大意:题目就是告诉你点和边的数量n和m,然后就是每条边连接的两个点和值,要你求出从1到n的最大流 递归版:#include <cstdio>#include <queue>#include <cstring>#include <vector>using namespace std

2016-08-25 21:06:22 309

原创 网络流三种算法及比较

核心代码 (1)EK 算法 复杂度O(V*E*E)#define N 204 int c[N][N];//边容量 int f[N][N];//边实际流量 int pre[N];//记录增广路径 int res[N];//残余网络 queue<int> qq; void init(){ while(!qq.empty())qq.pop(); mems

2016-08-25 18:23:25 1645

原创 高斯消元

模板#include<stdio.h>#include<algorithm>#include<iostream>#include<string.h> #include<math.h>using namespace std;const int MAXN=50;int a[MAXN][MAXN];//增广矩阵int x[MAXN];//

2016-08-24 21:24:40 180

原创 POJ 3233 Matrix Power Series(矩阵乘法)

#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring>#include<string>#include

2016-08-24 21:21:18 302

原创 大数运算模板

#include <iostream>#include <algorithm>#include <stdio.h>#include <string.h>using namespace std;#define MAX_DIGIT 500//大数运算:加法int Add(int *a,int *b,int *&result){ if(a==NULL || b==NULL || re

2016-08-24 11:59:09 388

原创 求三角形面积三种方式

#include <math.h>struct point{double x,y;};//计算cross product (P1-P0)x(P2-P0)double xmult(point p1,point p2,point p0){ return (p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y);}double xmult(double

2016-08-23 12:16:17 2443

原创 球面

#include <math.h>const double pi=acos(-1);//计算圆心角lat表示纬度,-90<=w<=90,lng表示经度//返回两点所在大圆劣弧对应圆心角,0<=angle<=pidouble angle(double lng1,double lat1,double lng2,double lat2){ double dlng=fabs(lng1-lng2

2016-08-23 12:14:53 593

原创 三角形各元素判断

#include <math.h>struct point{double x,y;};struct line{point a,b;};double distance(point p1,point p2){ return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));}point intersection(line u,lin

2016-08-23 12:13:44 399

原创 凸包

#include <stdlib.h>#define eps 1e-8#define zero(x) (((x)>0?(x):-(x))<eps)struct point{double x,y;};//计算cross product (P1-P0)x(P2-P0)double xmult(point p1,point p2,point p0){ return (p1.x-p0.x)*

2016-08-23 12:10:31 221

原创 网格

#define abs(x) ((x)>0?(x):-(x))struct point{int x,y;};int gcd(int a,int b){ return b?gcd(b,a%b):a;}//多边形上的网格点个数int grid_onedge(int n,point* p){ int i,ret=0; for (i=0;i<n;i++) ret

2016-08-23 12:09:29 284

原创

#include <math.h>#define eps 1e-8struct point{double x,y;};double xmult(point p1,point p2,point p0){ return (p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y);}double distance(point p1,point p2){

2016-08-23 12:07:51 230

原创 整数几何函数库

//注意某些情况下整数运算会出界!#define sign(a) ((a)>0?1:(((a)<0?-1:0)))struct point{int x,y;};struct line{point a,b;};//计算cross product (P1-P0)x(P2-P0)int xmult(point p1,point p2,point p0){ return (p1.x-p0.x

2016-08-23 12:06:30 338

原创 三维几何函数库

#include <math.h>#define eps 1e-8#define zero(x) (((x)>0?(x):-(x))<eps)struct point3{double x,y,z;};struct line3{point3 a,b;};struct plane3{point3 a,b,c;};//计算cross product U x Vpoint3 xmult(poin

2016-08-23 12:05:05 2376 1

原创 浮点几何函数库

#include <math.h>#define eps 1e-8#define zero(x) (((x)>0?(x):-(x))<eps)struct point{double x,y;};struct line{point a,b;};//计算cross product (P1-P0)x(P2-P0)double xmult(point p1,point p2,point p0){

2016-08-23 12:03:26 437

原创 多边形切割模板

//多边形切割//可用于半平面交#define MAXN 100#define eps 1e-8#define zero(x) (((x)>0?(x):-(x))<eps)struct point{double x,y;};double xmult(point p1,point p2,point p0){ return (p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p

2016-08-23 12:02:14 388

原创 多边形判断模板

#include <stdlib.h>#include <math.h>#define MAXN 1000#define offset 10000#define eps 1e-8#define zero(x) (((x)>0?(x):-(x))<eps)#define _sign(x) ((x)>eps?1:((x)<-eps?2:0))struct point{double x,y;

2016-08-23 11:58:32 310

原创 计算几何公式总结

一.注意 1. 注意舍入方式(0.5的舍入方向);防止输出-0. 2. 几何题注意多测试不对称数据. 3. 整数几何注意xmult和dmult是否会出界; 符点几何注意eps的使用. 4. 避免使用斜率;注意除数是否会为0. 5. 公式一定要化简后再代入. 6. 判断同一个2*PI域内 两角度差应该是 abs(a1-a2)<beta||abs(a1-a2)>

2016-08-23 11:56:25 1555

原创 POJ-1931 Biometrics

题目链接:http://poj.org/problem?id=1931判断两个多边形是否相似多边形相似充要条件:多边形A的任何两点之间长度,与多边形B对应的两个点长度比值都相等注意一下顺时针和逆时针,还有数值的范围*/#include <math.h>#include <stdio.h>#define eps 1e-6#define sqr(x) ((x) * (x))#define s

2016-08-22 16:23:35 291

原创 三维矩阵旋转

#include <iostream>#include <cmath>using namespace std;const double PI = acos(-1.0);const double eps = 1e-16;struct point3{ double x,y,z; point3(double a,double b,double c) {

2016-08-22 16:20:59 438

原创 半平面的核

【题意】给出很多个半平面,这里每个半平面由线段组成,都是指向线段方向的左边表示有 (x1 - x) * (y2 - y) - (x2 - x) * (y1 - y) >=0 ( >=0 表示左边,<=0 表示右边) 要你求个半平面的核,就是所有半平面所围成的面积 【算法】O(nlogn)的半平面交算法,最后统计出得到的多边形的点,然后利用叉积公式求出面积就行了#include<cstdio>

2016-08-22 16:17:16 224

原创 POJ-2208 Pyramids (Northeastern Europe 2002)

题目链接:http://poj.org/problem?id=2208 四面体体积计算: 四面体ABCD的体积是V,AB=a,AC=b,AD=c,CD=p,DB=q,BC=r, 设P1=(ap)2(–a2+b2+c2–p2+q2+r2), P2=(bq)2(a2–b2+c2+p2–q2+r2), P3=(cr)2(a2+b2–c2+p2+q2–r2), P=(abr)2+(acq)2+(

2016-08-22 16:12:33 338

原创 求包含点集的最小正方形个数。

把枚举数量减少下来,这里用到逼近迭代,就是先m分枚举范围,从中找到最小的,然后再在那个区间m分,这样迭代下去。#include <iostream>#include <math.h>using namespace std;const int MAX = 305;const double PI = asin(1.0) * 2;const double EPS = 1e-6;int n;d

2016-08-22 16:07:25 659

原创 旋卡求凸包直径

#include <iostream>#include <algorithm>using namespace std;const int maxn = 50005;struct point{ int x,y; bool operator<(const point a)const { return y < a.y ||(y == a.y && x <

2016-08-22 16:03:19 303

原创 求圆面积并

#include<stdio.h>#include<math.h>#include<algorithm>using namespace std;//(坐标、半径为-10000..10000)const int chash=12343;const double zero=1e-8;int n,nodes;double pi;const int nSIZE=1010;double x

2016-08-22 16:01:22 616

原创 求圆和多边形的面积交

#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <cstdlib>#include <iostream>#include <ctime>using namespace std;#define M 30#define eps 1e-7const double PI = a

2016-08-22 15:59:24 1256

原创 凸包求面数和表面积

面数#include<stdio.h>#include<math.h>#include<algorithm>#define eps 1e-7#define MAXV 305using namespace std;struct pt{ double x, y, z; pt() {} pt(double _x, double _y, double _z): x(_x

2016-08-21 18:57:32 558

原创 二分图的两种算法-最大匹配与最优匹配 poj--1469,2536

1.最大匹配 题目大意:给你p门课程和n个学生,一个学生可以选0门,1门,或者多门课 程,现在要求一个由p个学生组成的集合,满足下列2个条件: (1).每个学生选择一个不同的课程 (2).每个课程都有不同的代表 如果满足,就输出YES#include<cstdio>#include<cstring>using namespace std;#def

2016-08-21 16:15:32 1002

原创 最短路-四种算法复杂度分析比较 HDU-1874 畅通工程

样例解析: 每组数据第一行包含两个正整数N和M(0#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;const int inf = 1<<30;int n,m;int map[300][300];int vis[300],cast[300];void Dijkstra(int s

2016-08-21 11:24:56 2060

转载 清华吴翼学长——ACM参赛故事

2013年ACM/ICPC全球总决赛世界第12名从我接触程序竞赛到现在应该有十多年了,单说ACM竞赛,从第一次非正式参赛到现在也差不多有7年多的样子。有太多的故事,想说的话,却一直没能有机会写下来。一方面是自己忙,一方面也是自己懒。所以很感谢能有人“逼”我来写点什么。想到会有很多人来读我写的文字,自己也觉得很开心。其实每个人的生活都是一部电影,只是没有那么多幸运的人有机会去诉说。这里,且说三个小故事

2016-08-20 17:17:45 3921

转载 搞ACM你伤不起

劳资N年前开始搞ACM啊!!!!!!!!!! 从此踏上了尼玛不归路啊!!!!!!!!!!!! 谁特么跟劳资讲算法是程序设计的核心啊!!!!!! 尼玛除了面试题就没见过用算法的地方啊!!!!!! 谁再跟劳资讲算法之美算法的力量,劳资一本算法导论拍死你啊!!!!!!!! 那是搞ACM的入门书啊!!!!特么的入门书就一千多页啊!!!!!!! 还没有习题答案啊,学完了你特么都不知道自

2016-08-20 17:08:35 540

转载 给搞算法领域新人建议

一、语言是最重要的基本功 无论侧重于什么方面,只要是通过计算机程序去最终实现的竞赛,语言都是大家要过的第一道关。亚洲赛区的比赛支持的语言包括C/C++与JAVA。笔者首先说说JAVA,众所周知,作为面向对象的王牌语言,JAVA在大型工程的组织与安全性方面有着自己独特的优势,但是对于信息学比赛的具体场合,JAVA则显得不那么合适,它对于输入输出流的操作相比于C++要繁杂很多,更为重要的是JAVA程序

2016-08-20 17:07:21 2971 2

原创 poj-最多长方形数

题意:紧贴X轴有一些相互挨着的长方形,给定每个长方向的长和宽,求形成最大矩形是多少。#include<stdio.h>#include<stdlib.h>#include<stack>#include<iostream>#include<algorithm>using namespace std;struct node{ int a; int b;} aa;int

2016-08-20 16:29:26 466

原创 最小生成树-两种算法复杂度比较 poj-1258,2485

1.Prim算法 时间是复杂度O(n2),适合稠密图。 例:Poj–1258 题目大意:n个城市建造光缆,要使这些城市直接通信,并且光缆费用最小。 #include <cstdio>#include <string.h>#define n 10010#define inf 100010int a[n][n],ans;bool vis[n],t;int dis[n];bool pr

2016-08-20 11:37:47 5659

原创 九大排序算法的手写实现及时空复杂度分析 笔试面试必备

1、冒泡排序 冒泡排序是一种简单的排序方法,算法如下: 1. 首先将所有待排序的数字放入工作列表中。 2. 从列表的第一个数字到倒数第二个数字,逐个检查:若某一位上的数字大于他的下一位,则将它与它的下一位交换。 3. 重复2号步骤(倒数的数字加1。例如:第一次到倒数第二个数字,第二次到倒数第三个数字,依此类推…),直至再也不能交换。 用C语言实现如下:#include <iostream>

2016-08-19 11:08:55 4212

原创 HLG 1879 G数

题目链接:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1879 题意:G数就是一个数经过平移多次相加所生成的数。 其实就是1,11,111,1111….的倍数#include <stdio.h>#include <string.h>#include <iostream>#include <

2016-08-19 10:51:59 346

原创 2016多校联赛 HDU 5858 Hard problem

题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5858 题意:求阴影部分面积#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>using namespace std;#define PI acos(-1.0)int main(){

2016-08-18 19:56:28 458

运筹学-第二版-(吴祁宗-著)-课后习题答案-机械工业出版社

运筹学-第二版-(吴祁宗-著)-课后习题答案-机械工业出版社

2018-10-04

人工智能基础

artificial intelligence,人工智能,入门书,Introduction to artificial intelligence

2018-10-04

人工智能导论

AI,Introduction to artificial intelligence,人工智能

2018-10-04

统计学习理论的本质

统计学习理论的本质,The nature of statistical learning theory

2018-10-04

Pattern Recognition and Machine Learning(完整答案)

Pattern Recognition and Machine Learning(完整答案),课后答案,模式识别与机器学习

2018-10-04

Neural Network Methods for Natural Language Process

Neural Network Methods for Natural Language Process,基于深度学习的自然语言处理

2018-10-04

LDA数学八卦

LDA数学八卦,Mathematics gossip,LDAMathematics gossip

2018-10-04

深入剖析卷积神经网CNN

CNN_book,卷积神经网,Convolutional neural network

2018-10-04

Machine Learning - A Probabilistic Perspective

Machine Learning - A Probabilistic Perspective,机器学习-一个概率的观点

2018-10-04

Pattern Recognition and Machine Learning

Pattern Recognition and Machine Learning,AI,PRML

2018-10-01

统计学完全教程

Complete course on statistics,统计学完全教程,人工智能

2018-10-01

编程面试和算法

AI, artificial intelligence,面试,算法,心得。AI, artificial intelligence

2018-10-01

统计学习方法-李航(最新版)

AI,统计学习方法,李航,人工智能。AI, statistical learning method, li hang, artificial intelligence

2018-10-01

Applications of Topic Models

Applications of Topic Models,Applications of Topic Models机器学习必备

2018-10-01

Bayesian Reasoning and Machine Learning

机器学习必备Bayesian Reasoning and Machine Learning

2018-10-01

最优化导论(第四版)课后答案

最优化导论答案,机器学习必备,AN INTRODUCTION TO OPTIMIZATION

2018-10-01

空空如也

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

TA关注的人

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