ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1644. A Whole Lot of Walnuts

Помогите!!!
Posted by Dj_Denis 11 Nov 2009 22:54
На 7 или на 8 тесте ошибка но все тесты что я видел все правильно идут вот код:
var
state:string;
n,i,k,max,min:integer;
h,s:boolean;
begin
readln(n);
min:=10;
max:=3;
for i:=1 to n do begin
                 readln(k,state);
                 delete(state,1,1);
                 if state='hungry' then begin
                                        if h=false then begin
                                                        max:=k;
                                                        h:=true;
                                                        end;
                                        if max<k then max:=k;
                                        end else begin
                                                 if s=false then begin
                                                                 min:=k;
                                                                 s:=true;
                                                                 end;
                                                 if min>k then min:=k;
                                                 end;
                 end;
if max>=min then write('Inconsistent') else write(min);
end.