|
|
вернуться в форумОбщий форумcan anyone give me some tests for 1190? I always get wa on test 7thanks above var n,j:integer; total:real; t:array[1..5000]of shortint; v:array[1..5000]of longint; procedure init; var I,b,j:integer; a:char; c:longint; begin readln(N); for i:=1 to n do begin read(a); while a=' ' do read(a); while a<>' ' do read(a); read(b); if b=1 then begin read(c); v[i]:=c; t[i]:=1; for j:=1 to i-1 do if t[j]=0 then begin total:=total+c; t[j]:=1; v[j]:=c; end else if t[j]=1 then begin if c>v[j] then begin write('NO'); halt; end; end; total:=total+c; end else t[i]:=0; readln; end; end; begin init; if total>10000 then write('NO') else write('YES'); end. Edited by author 31.07.2004 07:07 Edited by author 01.08.2004 08:25 Re: can anyone give me some tests for 1190? I always get wa on test 7thanks Try this: 3 a 1 5000 b 0 c 1 2000 The correct answer is YES. Good luck! Edited by author 31.07.2004 15:31 Re: can anyone give me some tests for 1190? I always get wa on test 7thanks Thanks. I have already fixed my program but also get wa. can anyone help me? Re: can anyone give me some tests for 1190? I always get wa on test 7thanks And what about this test? 2 a 1 4000 b 0 The correct answer is NO. Hint: you should calculate both minimum and maximum possible sum of percentage. But you calculate only one of them. Re: can anyone give me some tests for 1190? I always get wa on test 7thanks I know thanks. |
|
|