
ACM_程序
文章平均质量分 77
xyzhk01
这个作者很懒,什么都没留下…
展开
-
计算几何 Graham_scan凸包 pku 1113
http://162.105.81.212/JudgeOnline/problem?id=1113/*************凸包 1113pku Graham_scan */#include//#include#includeusing namespace std;struct point{ double x,y;}one;//vector PointSet,ch;point PointSet[1005],ch[1005];double dis(poin原创 2010-07-21 11:09:00 · 495 阅读 · 0 评论 -
poj 1191 DP by:me
<br />#include<iostream>#include<cmath>using namespace std;#define INF 0x3ffffffint map[9][9];int dp[15][9][9][9][9];int s[9][9][9][9];int ss(int i,int j,int k,int h){ int sum=0; for(;i<=k;i++) for(int x=j;x<=h;x++)原创 2010-06-17 22:06:00 · 595 阅读 · 0 评论 -
poj 1191 DP by:other
<br />#include < iostream > #include < cmath > #include<iomanip>#define INF 10000000 using namespace std; const int m = 8 ; int a[ 10 ][ 10 ]; int n; double dp[ 16 ][ 10 ][ 10 ][ 10 ][ 10 ], s[ 10 ][ 10 ][ 10 ][ 10 ];原创 2010-06-17 22:07:00 · 504 阅读 · 0 评论 -
Prim 模板 hdu 1879
<br />#include<iostream>using namespace std;#define INF 0x111111int ancs[101][101];int dis[101];//结点1到其他点的距离 int min_rode;int Prim(int m){ int min,k; for(int i=2;i<=m;i++) dis[i]=ancs[1][i]; dis[1]=0; for(int i=1原创 2010-06-18 15:29:00 · 414 阅读 · 0 评论 -
zjut 1517 Miller_Rabin
#include //#include //#include using namespace std;int mul(int a,int b,int m)//a * b % m{ int ret = 0; while (b > 0) { if (b & 1) ret = (ret + a) % m; b >>= 1; a = (a 0) { if (原创 2010-08-08 14:52:00 · 668 阅读 · 0 评论 -
PKU 2993 模拟 c++
<br />#include <iostream>#include <string.h>using namespace std;char map[20][35];void init(char map[][35]){ for(int i=17;i>=1;i--) { if(i%2==1) strcpy(map[i],"+---+---+---+---+---+---+---+---+"); else if(i/2%2==1原创 2010-06-09 12:32:00 · 393 阅读 · 0 评论 -
PKU 2632 Crashing Robots 模拟
题意简述:在一个b*a的矩形框内,有n个机器人,告诉其初始位置及方向。 现有m条指令,每条指令可能是转向或者向前走一步。 试判断有没有冲突或者撞墙的情况。解题思路:模拟题目网址:http://162.105.81.212/JudgeOnline/problem?id=2632//模拟 #includeusing namespace std;struct robot{ int x,y; //x:机器人所在行; y:所在列 int pr;原创 2010-06-05 00:14:00 · 546 阅读 · 0 评论 -
PKU 1459 Ford_Fulkerson(可以做模板)
<br />#include<iostream>#include<queue>using namespace std;#define VMAX 102int s,t;int father[VMAX];int c[VMAX][VMAX];//顶点从0--(n-1)int Ford_Fulkerson( ){ while(1) { queue <int> q; memset(father, -1, sizeof(fa原创 2010-06-01 20:10:00 · 474 阅读 · 0 评论 -
Bellman_Ford模板
// Bellman_Ford.cpp : Defines the entry point for the console application.//热哦//dfs#define MAX_VERTEX_NUM 101#define INFINITY 0x11111111#define TRUE 1#define FALSE 0typedef struct{ //int info;}VertexType;typedef struct{ int val; //int info;}ArcTyp原创 2010-05-31 13:45:00 · 495 阅读 · 0 评论 -
有道难题 有道搜索框
//水过去,不是用最优算法的,只是随便优化下,调用STL的库函数简便直观地水过去 #include#include#include#include#includeusing namespace std; int main() { //freopen("in.txt","r",stdin); int n,m; vector v; string str; map M; cin >> n; for(int i = 0;转载 2010-05-31 13:05:00 · 545 阅读 · 0 评论 -
母函数 hdu 1398
<br />/*母函数G(x)=(1+x+x2+x3+x4+…)(1+x4+x8+x12+…)(1+x9+x18+x27+…)…hdu1398*/#include <iostream>using namespace std;const int lmax=330;int c1[lmax+1],c2[lmax+1];//下标表示x的几次方,c1[i]的值表示x的系数,即多少种;int main(void){ int n,i,j,k; n=300; for原创 2010-07-21 11:29:00 · 444 阅读 · 0 评论 -
FLOYD_NUAA_1635
<br />#include <string.h>#include <iostream>using namespace std;#define MAX_VERTEX_NUM 101#define INFINITY 0x11111111#define TRUE 1#define FALSE 0typedef struct{ //int info;}VertexType;typedef struct{ int val; //int inf原创 2010-06-18 16:09:00 · 558 阅读 · 0 评论