题目链接:hdu1548
声明:本文摘自 sunkehappy#include <stdio.h>#define DEBUG 0const int N=300 ;const int Max = 10000000 ;int n, map[N][N], used[N], dis[N] ;void Dijkstra( int a, int b ){ int i, j, index, min ; for( i=1; i<=n; ++i ){ dis[i] = map[a][i] ; used[i] = 0 ; } used[a] = 1...
题目:pku3348
代码:
//1 ≤ n ≤ 10000 where -1000 ≤ x, y ≤ 1000#include <iostream>#include <algorithm>#include <cmath>using namespace std;/*==================================================*\| Graham 求凸包 O(N * logN)| CALL: nr = graham(pnt, int n, res); res[]为凸包点集;\*==============================...
程序语言
1967年5月20日,在挪威奥斯陆郊外的小镇莉沙布举行的IFIP TC-2 工作会议上,挪威科学家Ole-Johan Dahl和Kristen Nygaard正式发布了Simula 67语言。Simula 67被认为是最早的面向对象程序设计语言,它引入了所有后来面向对象程序设计语言所遵循的基础概念:对象、类、继承。之后,在1968年2月形成了Simula 67的正式文本。 挪威科学家Ole-Johan Dahl,Kristen Nygaard 也是在1968年,荷兰教授E.W.Dijkstra提出了“GOTO语句是有害的”观点,指出程序的质量与程序中所包含的GO...
Smalltalk和许多程序设计语言不同,它不仅仅是一门语言。下面我们从几个不同的角度来解释Smalltalk。 一种面向对象的程序设计语言:它是一种面向对象的语言,包含语言的语法和语义。一些编译器可以通过Smalltalk源程序产生可执行文件。这些编译器通常产生一种能在虚拟机上运行的二进制代码。Smalltalk语言本身非常精炼。 一种程序设计环境:这里指的是一种提供许多 对象 的系统,而不是某种特殊的开发环境。和许多语言不同(包括C++),Smalltalk附带有一个巨大的、相当标准的类库。这些 类 使得开发Smalltalk程序的效率非常高。在其它语言(例如 Ada , C 和 P...
做个课设的程序,总是出问题,真的很烦,也不知道谁能拯救我这个程序,默默祈祷能有某位大侠出现吧
pku1113wall
//3 <= N <= 1000) 1 <= L <= 1000) (-10000 <= Xi, Yi <= 10000) #include <iostream>#include <algorithm>#include <cmath>using namespace std;const double pi=acos(-1.0);struct point //点 { double x,y; };double dist(point p1,point p2) //两点间的距离 { double x1=p1.x-p2.x,y1=p1.y-p2...
演示工程下载
unit My_KeyBD_Event;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); ...
演示工程下载
unit Mouse_Event_Demo;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Menus;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; PopupMenu1: TPopupMenu; N1: TMenuItem; ioriliao1:...
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,TLHelp32,PSAPI, ComCtrls;type TForm1 = class(TForm) Panel1: TPanel; Panel2: TPanel; Button1: TButton; ListView1: TListView; procedure Button1Click(Se...
ACM新手,离散数学,组合数学,初等数论,线性代数,计算几何····任重道远。
只要努力,就有机会。
初期:
一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法: (1)图的深度优先遍历和广度优先遍历. (2)最短路径算法(...
题目:pku1556
方法:直线相交判断+dijkstra算法
思路:把每个门的两点看成图中的一个点,构造一个以两点距离为权值的图(如果不可直达,记为INF),
再用dijkstra算法求出两个端点点的最短路。
注意:不要用memset初始化g,d;用memset初始化为非0值时,其值并非我们想象的,尽管那值很稳定。
如定义一个数组long a[20];memset(a,1,sizeof(a));用一个循环语句将各元素输出,其值都一样。
但并不是1,而是16843009。
//0 <= n <= 30 #include<iostream> #includ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>随滚动条移动的层 - <A href="http://www.aa25.cnwww.aa25.cn</TITLE><META HTTP-EQUIV="Content-Type" CONTENT="text/html" charset="gb...
JSP EL
核心作用
减少2JSP页面中的java代码
方便jsp中代码的修改,也方便美工修改页面
例如:${10+10}
<h2>Hello,${user.name}</h2>
运算符
类型
定义
算术型
+、-、*、/=div、%=mod
逻辑型
And=&&,or=|,!=not
关系运算型
==、eq,!、ne,>、gt,、<=、le、>=、ge、<、lt、
条件型
A?b:c
空
empty
以上写代,后面的英文可以代替前面的符号
...
国际化的应用java语言对国际化的支持1,ResourcedBu2,Locale获得java对国际化的支持Locale[] locales=Locale.getAvailableLocales);for(Locale locale:locales){locale.getDisplayCountry+locale.getCountry}~~~~~~~~getCountry()返回此语言环境的国家/地区代码getDisplayLanguage() 返回适合向用户显示的语言环境语言名。getLanguage()返回此语言环境的语言代码```````struts2中的文件类名_国家_国家名.p...
我现在是晕死了,怎么弄JAVA啊, 连JDK都弄不好,晕死,JDK怎么设置啊,有高手知道吗?还有用Eclipse不是说不用装JDK么?怎么提示说得装JDK或者JRE,晕死,还有用UE是不是还得设置JDK了,有高手给说一下,加我QQ443969881,亲自教一下吧,谢谢了。
题目链接:pku1066(经典)
代码一:线段相交+枚举
//0 <= n <= 30 #include<iostream>#include <algorithm>#include<cmath>using namespace std;struct point{ double x,y; }; struct line{ point s, e; };double max(double a,double b){ return a>b?a:b; }double min(double a,double b){ return a<b?a:b; ...
struts2框架校验的两种方式:一:编码式校验,自己编写校验判断,也叫field校验1.在Action类中重写validate()方法,编写自己的校验判断语句,然后调用addFieldError方法返回错误提示信息,如EnrollAction.java类private String username;private String password;getter/setter()@Overridepublic void validate(){ if(getUsername()== null || getUsername().equals("")){ this.addFieldError...
//2010-01-19 yaojianming 摘自unix网络编程2// 编译:g++ luts.cpp -o luts -lpthread#include <stdio.h>#include <unistd.h>#include <pthread.h>#define MAXNITEMS 100000#define MAXNTHREADS 10int nitems = MAXNITEMS;int buff[MAXNITEMS];struct val { pthread_mutex_t mutex; int nput; int nval;} put = { PT...
http://acm.pku.edu.cn/JudgeOnline/problem?id=2653
//with 1 <= n <= 100000, the number of sticks for this case//these numbers are the planar coordinates of the endpoints of one stick// You may assume that there are no more than 1000 top sticks#include<iostream>#include<cmath>using namespace std...
找老师
+Q729083992