|
|
back to boardPlease help! Why "Wrong Answer"? Please help! Why "Wrong Answer"? Var n,q,i,j : longint; s,e,suma : longint; a : array [1..10010] of longint; Begin readln(n); for i:=1 to n do readln(a[i]); readln(q); for i:=1 to q do Begin suma:=0; readln(s,e); for i:=s to e do suma:=suma+a[i]; writeln(suma); End; End. see+++++++++++++ Var n,q,i,j : longint; s,e,suma : longint; a : array [1..10010] of longint; Begin readln(n); for i:=1 to n do readln(a[i]); readln(q); for i:=1 to q do Begin suma:=0; readln(s,e); for j:=s to e do suma:=suma+a[j]; {see i>>j} writeln(suma); End; End. but be time limit, Search for other way!!! Re: see+++++++++++++ With many thanks for help, for specified mistake. I have got Time Limit, and has remade algorithm and has finally got AC |
|
|