- 计算系数
- 2012-10-27 08:41:14 @
program p1739;
var
a,b,n,m,k,i,j,t:longint;
ans:int64;
c:array[0..1001,0..1001]of longint;
begin
readln(a,b,k,n,m);
c[0,0]:=1;
c[1,0]:=1;
c[1,1]:=1;
a:=a mod 10007;
b:=b mod 10007;
for i:=2 to k do
begin
c:=1;
c:=1;
for j:=1 to i do
c:=(c+c) mod 10007;
end;
ans:=1;
for i:=2 to n do ans:=((ans mod 10007)*a) mod 10007;
for i:=2 to m do ans:=((ans mod 10007)*b) mod 10007;
if n>m then t:=m else t:=n;
ans:=(ans*c[k,t]) mod 10007;
writeln(ans);
end.
1 条评论
-
2329884599 LV 6 @ 2014-12-17 15:38:58
program p1739;
var
a,b,n,m,k,i,j,t:longint;
ans:int64;
c:array[0..1001,0..1001]of longint;
begin
readln(a,b,k,n,m);
c[0,0]:=1;
c[1,0]:=1;
c[1,1]:=1;
a:=a mod 10007;
b:=b mod 10007;
for i:=2 to k do
begin
c:=1;
c:=1;
for j:=1 to i do
c:=(c+c) mod 10007;
end;
ans:=1;
for i:=2 to n do ans:=((ans mod 10007)*a) mod 10007;
for i:=2 to m do ans:=((ans mod 10007)*b) mod 10007;
if n>m then t:=m else t:=n;
ans:=(ans*c[k,t]) mod 10007;
writeln(ans);
end.
- 1