大牛们,请帮我看看程序错在哪了??

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 条评论

  • @ 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

信息

ID
1739
难度
6
分类
数论 点击显示
标签
递交数
3866
已通过
1099
通过率
28%
被复制
17
上传者