| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1267 人关注过本帖
标题:我们昨天的acm题 分享一下
只看楼主 加入收藏
心剑菩提
Rank: 1
等 级:新手上路
帖 子:249
专家分:0
注 册:2007-5-17
收藏
 问题点数:0 回复次数:12 
我们昨天的acm题 分享一下

Local area network

Time Limit:1000MS Memory Limit:65536K
Total Submit:0 Accepted:0

Description

A local area network (LAN) supplies networking capability to a group of computers in close proximity to each other such as in an office building, a school, or a home. A LAN is useful for sharing resources like files, printers, games or other applications. A LAN in turn often connects to other LANs, and to the Internet or other WAN.
In this contest, everybody is connecting with each others like the following figure.


The contest’s network was built as N rows and M columns, your computer locate at (0, 0) and the judger’s computer locate at (m-1, n-1) The code you submit would only transfer to up or right smoothly. It doesn’t matter if some accidents happened. Could you tell me how many ways from your computer to judger when a data wire was broken?

Input

There are multiple cases. Every case contains two integers in the first line, N, M (3<=N+M<=40). Second line contains four integers X1, Y1, X2, Y2 (0<=X1, X2<M, 0<=Y1, Y2<N, |X1+Y1-X2-Y2|=1), meaning the broken wire position.

Output

Print the answer in one line.

Sample Input


3 3
0 0 1 0


Sample Output


3

搜索更多相关主题的帖子: acm 分享 
2007-10-29 14:19
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:我爱龙龙
等 级:贵宾
威 望:104
帖 子:9786
专家分:208
注 册:2006-5-23
收藏
得分:0 
你怎么老是发这样的题目
什么都要自己想一下吧
像你这样做ACM题目,你说有多大的进步呢?

倚天照海花无数,流水高山心自知。
2007-10-29 14:23
心剑菩提
Rank: 1
等 级:新手上路
帖 子:249
专家分:0
注 册:2007-5-17
收藏
得分:0 
我不赞同您说的 不见识一下别人
怎么看的到自己 希望您以及各位大哥大姐多指教
我会一直以你们为榜样

前世五百次的回眸 才换来今生的擦肩而过
2007-10-29 14:31
chmlqw
Rank: 1
等 级:新手上路
帖 子:180
专家分:0
注 册:2007-10-11
收藏
得分:0 
能不能翻译下......
2007-10-29 16:41
心剑菩提
Rank: 1
等 级:新手上路
帖 子:249
专家分:0
注 册:2007-5-17
收藏
得分:0 

我的在oj上通过了的
#include <iostream>
using namespace std;
int a[100][100];
int qiuhe(int m,int n)
{ int i,j;
long int sum=0;
if(m==0&&n==0)
sum=1;
else
{
for(i=0;i<=m;i++)
a[i][0]=1;
for(j=0;j<=n;j++)
a[0][j]=1;
for(i=0;i<m-1;i++)
for(j=0;j<n-1;j++)
a[i+1][j+1]=a[i][j+1]+a[i+1][j];
sum=a[m-1][n-1];
}
return sum;
}
int main()
{
int x1,y1,x2,y2,m,n,temp;
while(cin>>m>>n)
{
long int answer=0;
cin>>x1>>y1>>x2>>y2;
if(x1+y1>x2+y2)
{
temp=x1;x1=x2;x2=temp;
temp=y1;y1=y2;y2=temp;
}
answer=qiuhe(m,n)-qiuhe(y1+1,x1+1)*qiuhe(m-y2,n-x2);
cout<<answer<<endl;
}
}


前世五百次的回眸 才换来今生的擦肩而过
2007-10-30 20:59
死了都要C
Rank: 4
来 自:四川成都
等 级:贵宾
威 望:13
帖 子:1582
专家分:116
注 册:2006-12-7
收藏
得分:0 

我的意见是``LS以后发ACM题```随便给个汉化版本的```这里的人大多数都不看懂鸟语吧```

[此贴子已经被作者于2007-10-30 21:05:52编辑过]


女施主``我给你``送茶来了```师太``你就从了老衲吧``
代码本天成~~~妙头偶得之```
2007-10-30 21:05
心剑菩提
Rank: 1
等 级:新手上路
帖 子:249
专家分:0
注 册:2007-5-17
收藏
得分:0 
不看懂鸟语 又怎么消灭小鸟呢?????

前世五百次的回眸 才换来今生的擦肩而过
2007-10-30 21:34
chmlqw
Rank: 1
等 级:新手上路
帖 子:180
专家分:0
注 册:2007-10-11
收藏
得分:0 
回复:(心剑菩提)不看懂鸟语 又怎么消灭小鸟呢???...
暂时不要消灭小鸟嘛....
2007-10-30 21:42
xinfei1212
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-10-15
收藏
得分:0 

有点看不懂小鸟语言

2007-10-31 09:35
心剑菩提
Rank: 1
等 级:新手上路
帖 子:249
专家分:0
注 册:2007-5-17
收藏
得分:0 
这个题的意思是
以3*3为例

前世五百次的回眸 才换来今生的擦肩而过
2007-10-31 10:31
快速回复:我们昨天的acm题 分享一下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013456 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved