hdu 2962 题解
题意
给出一张图,每条道路有限高,给出车子的起点,终点,最高高度,问在保证高度尽可能高的情况下的最短路,如果不存在输出 $ cannot \ reach \ destination $
跟前面 $ hdu5418 $ 一样的,题目挺基础的,但是在细节方面比较抠。要是最高度尽可能高,我们就可以想去枚举可能的高度去跑 $ spfa $ ,但我们可以发现这样效率太低了,那么我们为什么不二分答案呢?给出最高高度了,最低不就是 $ 0 $ 吗?二分答案再去跑 $ spfa $ 加上限制条件。 这题时限 $ 10s $ 枚举其实一样能过,也跑得挺快的。另外我还敲了敲 $ floyd $ 果不其然,数据范围太大,它挂了。dijkstra它我也敲挂了(答案错误)等改对了再说吧。
比较坑的点:每组答案之间输出换行,因为这个格式错误了好几次。
代码(按时间从小到大排序
dijkstra(堆优化)+二分
$ 187MS $
/*
dijkstra(堆优化)+二分
Judge Status:Accepted
Exe.Time:187MS
Exe.Memory:1752K
Code Len:2640 B
*/
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
const int M=1000010;
const int INF=0x3f3f3f3f;
struct node{
int h;
int data;
}edge[M];
int head[N],ver[M],Next[M],ans,minf,n,m,tot,star,en,sum,addmin;
void add(int x,int y,int z,int hi){
ver[++tot]=y;edge[tot].data=z;edge[tot].h=hi;Next[tot]=head[x];head[x]=tot;
}
struct nod{
int data;
int num;
}minn[M];
int d[N];
bool book[N];
void shiftdownmin(int x){
int t,flag=0;
while(x*2<=addmin&&flag==0){
if(minn[x].data>minn[x*2].data)t=x*2;
else t=x;
if(x*2+1<=addmin){
if(minn[t].data>minn[x*2+1].data)t=x*2+1;
}
if(t!=x){
swap(minn[t],minn[x]);
x=t;
}else flag=1;
}
}
void shiftupmin(int x) {
int flag=0;
if(x==1) return;
while(x!=1&&flag==0){
if(minn[x].data<minn[x/2].data) swap(minn[x],minn[x/2]);
else flag=1;
x=x/2;
}
}
void dijkstra(int mi){
memset(book,0,sizeof(book));
memset(d,0x3f,sizeof(d));addmin=0;
d[star]=0;
minn[++addmin].data=0;
minn[addmin].num=star;
while(addmin){
int x=minn[1].num;
minn[1]=minn[addmin--];
shiftdownmin(1);
if(book[x]) continue;
book[x]=1;
for(int i=head[x];i;i=Next[i]){
int y=ver[i],z=edge[i].data;
if(d[y]>d[x]+z&&edge[i].h>=mi){
d[y]=d[x]+z;
minn[++addmin].num=y;
minn[addmin].data=d[y];
shiftupmin(addmin);
}
}
}
}
int main(){
while(scanf("%d %d",&n,&m)){
if((!n)&&(!m)) return 0;
if(sum) printf("\n");
memset(head,0,sizeof(head));tot=0;sum++;
int l=0,r=0;
for(int i=1;i<=m;++i){
int x,y,z,h;
scanf("%d %d %d %d",&x,&y,&h,&z);
if(h==-1) h=INF;
add(x,y,z,h);
add(y,x,z,h);
}scanf("%d %d %d",&star,&en,&r);
ans=0;minf=0;
while(l<=r){
int mid=(l+r)>>1;
dijkstra(mid);
if(d[en]!=INF){
if(mid>ans){
ans=mid;
minf=d[en];
} l=mid+1;
}else r=mid-1;
}
printf("Case %d:\n",sum);
if(ans!=0){
printf("maximum height = %d\n",ans);
printf("length of shortest route = %d\n",minf);
}else printf("cannot reach destination\n");
}
return 0;
}
spfa+二分
$ 218MS $
/*
spfa+二分
Judge Status:Accepted
Exe.Time:218MS
Exe.Memory:1740K
Code Len:1772 B
*/
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
const int M=1000010;
const int INF=0x3f3f3f3f;
struct node{
int h;
int data;
}edge[M];
int head[N],ver[M],Next[M],d[N],v[N],ans,minn,n,m,tot,star,en,sum;
void add(int x,int y,int z,int hi){
ver[++tot]=y;edge[tot].data=z;edge[tot].h=hi;Next[tot]=head[x];head[x]=tot;
}
queue<int>q;
void spfa(int mi){
memset(d,0x3f,sizeof(d));
memset(v,0,sizeof(v));
d[star]=0;v[star]=1;
q.push(star);
while(q.size()){
int x=q.front();q.pop();
v[x]=0;
for(int i=head[x];i;i=Next[i]){
int y=ver[i],z=edge[i].data;
if((d[y]>d[x]+z)&&edge[i].h>=mi){
d[y]=d[x]+z;
if(!v[y]) q.push(y),v[y]=1;
}
}
}
}
int main(){
while(scanf("%d %d",&n,&m)){
if((!n)&&(!m)) return 0;
if(sum) printf("\n");
memset(head,0,sizeof(head));tot=0;sum++;
int l=0,r=0;
for(int i=1;i<=m;++i){
int x,y,z,h;
scanf("%d %d %d %d",&x,&y,&h,&z);
if(h==-1) h=INF;
add(x,y,z,h);
add(y,x,z,h);
}scanf("%d %d %d",&star,&en,&r);
ans=0;minn=0;
while(l<=r){
int mid=(l+r)>>1;
spfa(mid);
if(d[en]!=INF){
if(mid>ans){
ans=mid;
minn=d[en];
}
l=mid+1;
}else r=mid-1;
}
printf("Case %d:\n",sum);
if(ans!=0){
printf("maximum height = %d\n",ans);
printf("length of shortest route = %d\n",minn);
}else printf("cannot reach destination\n");
}
return 0;
}
枚举+spfa
$ 390MS $
/*
spfa+枚举
Judge Status:Accepted
Exe.Time:390MS
Exe.Memory:1768K
Code Len:1668 B
*/
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
const int M=1000010;
const int INF=0x3f3f3f3f;
struct node{
int h;
int data;
}edge[M];
int head[N],ver[M],Next[M],d[N],v[N],ans,minn,n,m,tot,star,en,sum;
void add(int x,int y,int z,int hi){
ver[++tot]=y;edge[tot].data=z;edge[tot].h=hi;Next[tot]=head[x];head[x]=tot;
}
queue<int>q;
void spfa(int mi){
memset(d,0x3f,sizeof(d));
memset(v,0,sizeof(v));
d[star]=0;v[star]=1;
q.push(star);
while(q.size()){
int x=q.front();q.pop();
v[x]=0;
for(int i=head[x];i;i=Next[i]){
int y=ver[i],z=edge[i].data;
if((d[y]>d[x]+z)&&edge[i].h>=mi){
d[y]=d[x]+z;
if(!v[y]) q.push(y),v[y]=1;
}
}
}
}
int main(){
while(scanf("%d %d",&n,&m)){
if((!n)&&(!m)) return 0;
if(sum) printf("\n");
memset(head,0,sizeof(head));tot=0;sum++;
int l=0,r=0;
for(int i=1;i<=m;++i){
int x,y,z,h;
scanf("%d %d %d %d",&x,&y,&h,&z);
if(h==-1) h=INF;
add(x,y,z,h);
add(y,x,z,h);
}scanf("%d %d %d",&star,&en,&r);
ans=0;minn=0;
for(int i=r;i;--i){
spfa(i);
if(d[en]!=INF){
ans=i;
minn=d[en];
break;
}
}
printf("Case %d:\n",sum);
if(ans!=0){
printf("maximum height = %d\n",ans);
printf("length of shortest route = %d\n",minn);
}else printf("cannot reach destination\n");
}
return 0;
}
dijkstra(堆优化)+枚举
$ 405MS $
/*
dijkstra(堆优化)+枚举
Judge Status:Accepted
Exe.Time:405MS
Exe.Memory:1752K
Code Len:2558 B
*/
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
const int M=1000010;
const int INF=0x3f3f3f3f;
struct node{
int h;
int data;
}edge[M];
int head[N],ver[M],Next[M],ans,minf,n,m,tot,star,en,sum,addmin;
void add(int x,int y,int z,int hi){
ver[++tot]=y;edge[tot].data=z;edge[tot].h=hi;Next[tot]=head[x];head[x]=tot;
}
struct nod{
int data;
int num;
}minn[M];
int d[N];
bool book[N];
void shiftdownmin(int x){
int t,flag=0;
while(x*2<=addmin&&flag==0){
if(minn[x].data>minn[x*2].data)t=x*2;
else t=x;
if(x*2+1<=addmin){
if(minn[t].data>minn[x*2+1].data)t=x*2+1;
}
if(t!=x){
swap(minn[t],minn[x]);
x=t;
}else flag=1;
}
}
void shiftupmin(int x) {
int flag=0;
if(x==1) return;
while(x!=1&&flag==0){
if(minn[x].data<minn[x/2].data) swap(minn[x],minn[x/2]);
else flag=1;
x=x/2;
}
}
void dijkstra(int mi){
memset(book,0,sizeof(book));
memset(d,0x3f,sizeof(d));addmin=0;
d[star]=0;
minn[++addmin].data=0;
minn[addmin].num=star;
while(addmin){
int x=minn[1].num;
minn[1]=minn[addmin--];
shiftdownmin(1);
if(book[x]) continue;
book[x]=1;
for(int i=head[x];i;i=Next[i]){
int y=ver[i],z=edge[i].data;
if(d[y]>d[x]+z&&edge[i].h>=mi){
d[y]=d[x]+z;
minn[++addmin].num=y;
minn[addmin].data=d[y];
shiftupmin(addmin);
}
}
}
}
int main(){
while(scanf("%d %d",&n,&m)){
if((!n)&&(!m)) return 0;
if(sum) printf("\n");
memset(head,0,sizeof(head));tot=0;sum++;
int l=0,r=0;
for(int i=1;i<=m;++i){
int x,y,z,h;
scanf("%d %d %d %d",&x,&y,&h,&z);
if(h==-1) h=INF;
add(x,y,z,h);
add(y,x,z,h);
}scanf("%d %d %d",&star,&en,&r);
ans=0;minf=0;
for(int i=r;i;--i){
dijkstra(i);
if(d[en]!=INF){
ans=i;
minf=d[en];
break;
}
}
printf("Case %d:\n",sum);
if(ans!=0){
printf("maximum height = %d\n",ans);
printf("length of shortest route = %d\n",minf);
}else printf("cannot reach destination\n");
}
return 0;
}
dijkstra+二分
$ 1154MS $
/*
dijkstra+二分
Judge Status:Accepted
Exe.Time:1154MS
Exe.Memory:9376K
Code Len:2376 B
*/
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
const int M=1000010;
const int INF=0x3f3f3f3f;
struct node{
int h;
int data;
}dis[N][N];
int ans,minn,n,m,tot,star,en,sum;
node d[N];
bool book[N];
void dijkstra(int x){
memset(book,0,sizeof(book));
memset(d,0x3f,sizeof(d));
for(int i=1;i<=n;++i){
if(dis[star][i].h>=x) d[i].data=dis[star][i].data;
d[i].h=dis[star][i].h;
}
d[star].data=0;book[star]=1;
for(int i=1;i<n;++i){
int minx=INF;
int op=-1;
for(int j=1;j<=n;++j){
if(d[j].data<minx&&book[j]!=1&&d[j].h>=x){
minx=d[j].data;
op=j;
}
}
if(op!=-1){
book[op]=1;
for(int j=1;j<=n;++j){
if(d[j].data>d[op].data+dis[op][j].data&&(!book[j])&&(dis[op][j].h>=x)&&(d[op].h>=x)){
d[j].data=d[op].data+dis[op][j].data;
d[j].h=min(d[op].h,dis[op][j].h);
}
}
}
}
}
int main(){
while(scanf("%d %d",&n,&m)){
if((!n)&&(!m)) return 0;
if(sum) printf("\n");
memset(dis,0,sizeof(dis));sum++;
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
if(i==j) dis[i][j].data=0;
else dis[i][j].data=INF;
}
}
int l=0,r=0;
for(int i=1;i<=m;++i){
int x,y,z,h;
scanf("%d %d %d %d",&x,&y,&h,&z);
if(h==-1) h=INF;
if(h>dis[x][y].h){
dis[x][y].data=z;
dis[x][y].h=h;
}
dis[y][x].data=dis[x][y].data;
dis[y][x].h=dis[x][y].h;
}scanf("%d %d %d",&star,&en,&r);
ans=0;minn=0;
while(l<=r){
int mid=(l+r)>>1;
dijkstra(mid);
if(d[en].data!=INF){
if(mid>ans){
ans=mid;
minn=d[en].data;
} l=mid+1;
}else r=mid-1;
}
printf("Case %d:\n",sum);
if(ans!=0){
printf("maximum height = %d\n",ans);
printf("length of shortest route = %d\n",minn);
}else printf("cannot reach destination\n");
}
return 0;
}
以下是非AC代码
/*
dijkstra+枚举
Judge Status:Time Limit Exceeded
Exe.Time:10000MS
Exe.Memory:9332K
Code Len:2287B
*/
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
const int M=1000010;
const int INF=0x3f3f3f3f;
struct node{
int h;
int data;
}dis[N][N];
int ans,minn,n,m,tot,star,en,sum;
node d[N];
bool book[N];
void dijkstra(int x){
memset(book,0,sizeof(book));
memset(d,0x3f,sizeof(d));
for(int i=1;i<=n;++i){
if(dis[star][i].h>=x) d[i].data=dis[star][i].data;
d[i].h=dis[star][i].h;
}
d[star].data=0;book[star]=1;
for(int i=1;i<n;++i){
int minx=INF;
int op=-1;
for(int j=1;j<=n;++j){
if(d[j].data<minx&&book[j]!=1&&d[j].h>=x){
minx=d[j].data;
op=j;
}
}
if(op!=-1){
book[op]=1;
for(int j=1;j<=n;++j){
if(d[j].data>d[op].data+dis[op][j].data&&(!book[j])&&(dis[op][j].h>=x)&&(d[op].h>=x)){
d[j].data=d[op].data+dis[op][j].data;
d[j].h=min(d[op].h,dis[op][j].h);
}
}
}
}
}
int main(){
while(scanf("%d %d",&n,&m)){
if((!n)&&(!m)) return 0;
if(sum) printf("\n");
memset(dis,0,sizeof(dis));sum++;
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
if(i==j) dis[i][j].data=0;
else dis[i][j].data=INF;
}
}
int l=0,r=0;
for(int i=1;i<=m;++i){
int x,y,z,h;
scanf("%d %d %d %d",&x,&y,&h,&z);
if(h==-1) h=INF;
if(h>dis[x][y].h){
dis[x][y].data=z;
dis[x][y].h=h;
}
dis[y][x].data=dis[x][y].data;
dis[y][x].h=dis[x][y].h;
}scanf("%d %d %d",&star,&en,&r);
ans=0;minn=0;
for(int i=r;i;--i){
dijkstra(i);
if(d[en].data!=INF){
ans=i;
minn=d[en].data;
break;
}
}
printf("Case %d:\n",sum);
if(ans!=0){
printf("maximum height = %d\n",ans);
printf("length of shortest route = %d\n",minn);
}else printf("cannot reach destination\n");
}
return 0;
}
/*
floyd+枚举
Judge Status:Time Limit Exceeded
Exe.Time:10000MS
Exe.Memory:9740K
Code Len:1819 B
*/
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
const int M=1000010;
const int INF=0x3f3f3f3f;
struct node{
int h;
int data;
}dis[N][N];
int ans,minn,n,m,tot,star,en,sum;
node d[N][N];
queue<int>q;
void floyd(int x){
memset(d,0x3f,sizeof(d));
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
if(dis[i][j].h>=x) d[i][j].data=dis[i][j].data;
d[i][j].h=dis[i][j].h;
}
}
for(int k=1;k<=n;++k){
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
if((d[i][j].data>d[i][k].data+d[k][j].data)&&(d[i][k].h>=x)&&(d[k][j].h>=x)){
d[i][j].data=d[i][k].data+d[k][j].data;
d[i][j].h=min(d[i][k].h,d[k][j].h);
}
}
}
}
}
int main(){
while(scanf("%d %d",&n,&m)){
if((!n)&&(!m)) return 0;
if(sum) printf("\n");
memset(dis,0,sizeof(dis));sum++;
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
if(i==j) dis[i][j].data=0;
else dis[i][j].data=INF;
}
}
int l=0,r=0;
for(int i=1;i<=m;++i){
int x,y,z,h;
scanf("%d %d %d %d",&x,&y,&h,&z);
if(h==-1) h=INF;
if(h>dis[x][y].h){
dis[x][y].data=z;
dis[x][y].h=h;
}
dis[y][x].data=dis[x][y].data;
dis[y][x].h=dis[x][y].h;
}scanf("%d %d %d",&star,&en,&r);
ans=0;minn=0;
for(int i=r;i;--i){
floyd(i);
if(d[star][en].data!=INF){
ans=i;
minn=d[star][en].data;
break;
}
}
printf("Case %d:\n",sum);
if(ans!=0){
printf("maximum height = %d\n",ans);
printf("length of shortest route = %d\n",minn);
}else printf("cannot reach destination\n");
}
return 0;
}
/*
/*
floyd+二分
Judge Status:Time Limit Exceeded
Exe.Time:10000MS
Exe.Memory:12212K
Code Len:1891 B
*/
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
const int M=1000010;
const int INF=0x3f3f3f3f;
struct node{
int h;
int data;
}dis[N][N];
int ans,minn,n,m,tot,star,en,sum;
node d[N][N];
queue<int>q;
void floyd(int x){
memset(d,0x3f,sizeof(d));
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
if(dis[i][j].h>=x) d[i][j].data=dis[i][j].data;
d[i][j].h=dis[i][j].h;
}
}
for(int k=1;k<=n;++k){
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
if((d[i][j].data>d[i][k].data+d[k][j].data)&&(d[i][k].h>=x)&&(d[k][j].h>=x)){
d[i][j].data=d[i][k].data+d[k][j].data;
d[i][j].h=min(d[i][k].h,d[k][j].h);
}
}
}
}
}
int main(){
while(scanf("%d %d",&n,&m)){
if((!n)&&(!m)) return 0;
if(sum) printf("\n");
memset(dis,0,sizeof(dis));sum++;
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
if(i==j) dis[i][j].data=0;
else dis[i][j].data=INF;
}
}
int l=0,r=0;
for(int i=1;i<=m;++i){
int x,y,z,h;
scanf("%d %d %d %d",&x,&y,&h,&z);
if(h==-1) h=INF;
if(h>dis[x][y].h){
dis[x][y].data=z;
dis[x][y].h=h;
}
dis[y][x].data=dis[x][y].data;
dis[y][x].h=dis[x][y].h;
}scanf("%d %d %d",&star,&en,&r);
ans=0;minn=0;
while(l<=r){
int mid=(l+r)>>1;
floyd(mid);
if(d[star][en].data!=INF){
if(mid>ans){
ans=mid;
minn=d[star][en].data;
} l=mid+1;
}else r=mid-1;
}
printf("Case %d:\n",sum);
if(ans!=0){
printf("maximum height = %d\n",ans);
printf("length of shortest route = %d\n",minn);
}else printf("cannot reach destination\n");
}
return 0;
}
hdu 2962 题解的更多相关文章
- hdu 2962 Trucking (二分+最短路Spfa)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2962 Trucking Time Limit: 20000/10000 MS (Java/Others ...
- HDU 2962 Trucking
题目大意:给定无向图,每一条路上都有限重,求能到达目的地的最大限重,同时算出其最短路. 题解:由于有限重,所以二分检索,将二分的值代入最短路中,不断保存和更新即可. #include <cstd ...
- HDU 2023题解分析
我想说这道题我还没弄明白我错哪了,交了20多遍一直都是Runtime Error,改了N次还是不对,后来搜了一下,说是数组开小了,又把数组开大,还不对,又改发现一个平均值求错,再改,还不对,洗洗睡吧. ...
- 2014年北京网络赛 Instrusive HDU 5040 题解 优先队列
网赛的时候看了这道题,发现就是平常的那种基础搜索题. 由于加了一个特殊条件:可以一次消耗3秒或原地停留1秒. 那就不能使用简单的队列了,需要使用优先队列才行. 题意 告诉一副地图:一个起点,一个终点, ...
- UVALive 4223 / HDU 2962 spfa + 二分
Trucking Problem Description A certain local trucking company would like to transport some goods on ...
- hdu 5418 题解
第一眼看到这题,哇,这不是我刚做完的题吗?大水题!然后 这题表面很水,实际上有点坑. 题意 求经过 $ 1 - n $(不能遗漏) 并且回到 $ 1 $ 的最短路. 在看这题之前我们可以来看下这题 最 ...
- HDU 1231 题解
题面: 最大连续子序列 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem ...
- HDU - 5970 题解
题目链接 HDU - 5970 分析 很显然\(f(x,y)\)与\(f(x+y*k,y)\)的结果相同,因为它们在第一次取模后会变成相同的式子 我们再看一下数据的范围,突破口肯定在\(m\)那里 那 ...
- 传递 HDU - 5961 题解
题目传送门 分析 题目大意:给一个竞赛图,将图分成两部分,判断两部分的图是否符合传递闭包,a->b,b->c,则a->c 这道题用Floyd硬跑的显然n\({^3}\)会T 如果用b ...
随机推荐
- junit4的初级用法
junit4初级用法: 一:各个标签的意思 1.@Test用来标注测试函数 2.@Before用来标注此函数在每次测试函数运行之前运行(每执行一个@Test之前都要运行一遍@Before) 3.@Af ...
- [后端]gitlab之gitlab-ci自动部署
转发:https://www.jianshu.com/p/df433633816b 简介 gitlab-ci全称是gitlab continuous integration的意思,也就是持续集成.中心 ...
- 洛谷 P1226 【模板】快速幂||取余运算 题解
Analysis 快速幂模板,注意在最后输出时也要取模. 快速幂模板 inline ll ksm(ll x,ll y) { ll ans=; ) { ) { ans*=x; ans%=k; } x*= ...
- 开源项目 06 NPOI
using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; using System; using S ...
- 计蒜客 39272.Tree-树链剖分(点权)+带修改区间异或和 (The 2019 ACM-ICPC China Shannxi Provincial Programming Contest E.) 2019ICPC西安邀请赛现场赛重现赛
Tree Ming and Hong are playing a simple game called nim game. They have nn piles of stones numbered ...
- 58、Spark Streaming: DStream的output操作以及foreachRDD详解
一.output操作 1.output操作 DStream中的所有计算,都是由output操作触发的,比如print().如果没有任何output操作,那么,压根儿就不会执行定义的计算逻辑. 此外,即 ...
- 第12组 Beta测试(5/5)
Header 队名:To Be Done 组长博客 作业博客 团队项目进行情况 燃尽图(组内共享) 展示Git当日代码/文档签入记录(组内共享) 注: 由于GitHub的免费范围内对多人开发存在较多限 ...
- Python实现 "反转字符串中的元音字母" 的方法
#coding=utf- def reverseVowels(s): """ :type s: str :rtype: str """ sS ...
- mysql 字段拼接
mysql> select concat(name,"**",id) as test from test; +----------------+ | test | +---- ...
- Serlvet开发
javaweb学习总结(五)——Servlet开发(一) 一.Servlet简介 Servlet是sun公司提供的一门用于开发动态web资源的技术. Sun公司在其API中提供了一个servlet接口 ...