足球比赛Word下载.docx
《足球比赛Word下载.docx》由会员分享,可在线阅读,更多相关《足球比赛Word下载.docx(21页珍藏版)》请在冰豆网上搜索。
评论人:
MissJuliet
发布时间:
2011-6-2711:
26:
15
Apply
the
GOOD
JOB
for
College
ACMers
to
Make
Large
Money
and
Become
a
Millionaire
Hello,
We
need
large
no.
of
dedicated
hard
working
ACMers.
The
payment
is
good
so
we
be
efficient.
All
you
have
do
get
job
sign
up
at
our
websites.
link
websites
are
given
below.
http:
//www.PaisaL
After
registration,
confirmation
email
will
sent
your
specified
address.
Please
click
on
inside
activate
account
recieve
ACM
work
instantly.
For
any
other
queries
can
mail
administrator.
Miss
Juliet
Admin
bulijun1987
2009-3-2022:
23:
10
有点深奥
09
01
forloop
2009-1-1116:
43:
25
#include
<
algorithm>
iostream>
stdio.h>
assert.h>
memory>
utility>
vector>
functional>
math.h>
numeric>
using
namespace
std;
#define
MAX_PLAYER
101
MAX_PASS
401
START_PLAYER
1
MARK_VALUE
(-1)
int
end;
//to
n+1;
m,n;
struct
_Node
{
in[MAX_PLAYER];
float
in_f[MAX_PLAYER];
};
_Node
nodes[MAX_PLAYER];
bool
isMin(pair<
int,int>
&
a,pair<
b)
return
nodes[a.second].in_f[a.first]
nodes[b.second].in_f[b.first];
}
inline
void
ReadAndFill(FILE
*file)
a,b;
f;
i=m;
while(i--
>
0)
fscanf(file,"
%d
%f\n"
&
a,&
b,&
f);
++nodes[b].in[a];
//there
path
from
a-->
b
nodes[b].in_f[a]
=
//the
cost
b
store
here
//printf("
a,b,f);
_ResolvePath(vector<
pair<
path,int
level,int
start)
path.push_back(make_pair(start,level));
s
START_PLAYER;
while
(1)
*r
find_if(nodes[start].in+s,
nodes[start].in+end,
bind2nd(greater<
int>
(),0));
if(r
==
nodes[start].in+end)
break;
index
((int)r
-
(int)&
nodes[start].in)
/
sizeof(int);
_ResolvePath(path,start,index);
+
1;
ResolvePath(vector<
float>
toDefence)
vector<
path;
start
find_if(nodes[n].in+start,
nodes[n].in+end,
nodes[n].in+end)
nodes[n].in)
_ResolvePath(path,n,index);
*p
min_element(path.begin(),path.end(),isMin);
p->
first;
second;
if(nodes[to].in[from]
MARK_VALUE)
//We
add
this
path.
else
toDefence.push_back(nodes[to].in_f[from]);
nodes[to].in[from]
MARK_VALUE;
main()
//pseudocode:
//while
n
m
!
//do
//ReadAndFill
//Resolve
every
path,make
smallest
in
as
marked.
//output
//end
FILE
*f
fopen("
data.dat"
"
rb"
);
assert(f);
//we
temp
here
toDefence;
//for
calculation
fscanf(f,"
%d\n"
n,&
m);
do{
end
ReadAndFill(f);
ResolvePath(toDefence);
i;
/*
printf("
size=%d\n"
toDefence.size());
for(i=0;
i<
toDefence.size();
++i)
%.6f"
toDefence[i]);
*/
beforePow
*=
(1-toDefence[i]);
output
pow(beforePow,(float)1
(float)toDefence.size());
if(output
opponent
too
strong!
\n"
else
if
(output
1)
week!
%.6f\n"
output);
toDefence.clear();
}while(n
0);
0;
wedgwood
2009-1-915:
08
恩,应该贪心算法可以使用,因为结果是几个数的几何平均值,只要数是大的,就不会拖整体结果的后腿。
雨雪妃妃
2008-12-19:
24:
16
楼下是外星人?
twwwater
2008-9-1512:
37:
51
感谢!
19
太好了,太谢谢了哈.......
利剑出鞘
2008-4-1211:
19:
34
好难哦
我会加油
2008-4-610:
20:
14
刚入门,的确有点深奥,不过真的感兴趣,希望自己能好好加油!
为我们国家的软件做点贡献!
志同道合的人和我一起努力吧
44
稀饭豁然
2008-3-1413:
04
看下这里的题
xiaomijsj
2008-3-28:
17:
31
搞不懂了哦!
!
火焰-凡提
2007-12-2818:
10:
05
我绝对还不会!
好向往哦!
jgjcq
2007-12-1911:
看晕了.....继续努力还得
勇气les
2007-7-67:
35
网络流,二分流量
zh867
2007-6-1916:
05:
33
呵呵。
。
真是玄乎呀!
不懂。
superyangjun
2007-4-2215:
39:
我的思路:
遍历所有从对方守门员到我方球门的进攻路径,找出每条进攻路径中我方队员防守成功概率最大的传球配合Ai(1=<
=100)将t个这样的最大概率想乘得到S;
令k=S^(1/t),再次遍历所有传球配合的概率。
找出其中除Ai外比k大的我方防守成功概率p。
令Q=(S*p)^(t+1)则得到了最大的防守可靠值Q。
例如对于输入:
4
4
1
2
0.5
0.6
3
0.8
我方的防守成功的概率:
①〈1,2,0.5〉〈2,3,0.5〉〈3,4,0.2〉
②〈1,2,0.5〉〈2,4,0.4〉
路径①中最大概率为0.5,路径②中最大概率为0.5。
这两个是同一个传球配合所以
S=0.5,t=1,k=0.5。
因为在除去最大概率后没有比k大的概率,所以Q=0.5。
再如输入:
0.9
我方防守成功的概率:
①〈1,2,0.5〉〈2,4,0.4〉〈3,4,0.2〉
②〈1,4,0.1〉
路径①中最大概率为0.5,路径②中最大概率为0.1。
所以.S=0.05,t=2,k=0.05^0.5〈0.3,在除去最大概率的传球配合中〈2,4,0.4〉成功的概率比0.3大,所以p=0.4,Q=(S*p)^(t+1)=(0.05*0.4)^(1/3)=0.271442
下面是我提交到
#include<
stack>
cmath>
iomanip>
main(){
n,m;
**cooperator;
stack<
result;
*
p;
cin>
n>
m;
while(n>
0){
//申请空间
p=new
float[(n+1)*(n+1)];
cooperator=new
float*[n+1];
for(int
i=0;
=n;
i++)
cooperator[i]=&
p[i*(n+1)];
//初始化数组,将传球防守概率保存在一个二维数组中
t=0;
t<
t++)
k=0;
k<
k++)
cooperator[t][k]=-1;
t++){
playerA,playerB;
possibility;
playerA>
playerB>
cooperator[playerA][playerB]=1-possibility;
//找出每条进攻路线的最大值,并求出其乘积和开方
float*>
searchMaxPossibility;
playerA=1,playerB=2;
submark=-1;
goal=n;
temp;
maxPosNO=0;
maxPossibility=0;
double
possibilityMultiply=1;
controlValue=0;
searchMaxOfOneWay;
while(playerA<
=goal&
=1){
controlValue++;
temp=cooperator[playerA][playerB];
temp>
1?
temp--:
//搜索未到球门
if(playerB<
goal){
//非空元素
if(temp>
=0){
//为最大概率
=maxPossibility){
submark++;
cooperator[0][submark]=temp;
maxPossibility=temp;
//纪录非空路径,寻找下一个配合者
searchMaxPossibility.push(&
cooperator[playerA][playerB]);
searchMaxOfOneWay=false;
playerA=playerB,playerB=2;
//空元素
playerB++;
//搜索到球门
else{
//非空单元
if(searchMaxPossibility.empty())maxPossibility=0;
//初始最大概率为;
//最大概率
if(cooperator[playerA][playerB]<
cooperator[playerA][playerB]++;
possibilityMultiply*=temp;
maxPosNO++;
searchMaxOfOneWay=true;
float*
tempPoint;
if(searchMaxPossibility.empty())
//搜索完毕
tempPoint=searchMaxPossibility.top();
playerA=(tempPoint-*cooperator)/(n+1);
playerB=(tempPoint-*cooperator)%(n+1)+1;
searchMaxPossibility.pop();
submark--;
if(submark<
0)
maxPossibility=cooperator[0][submark];
//不是最大概率