|
|
вернуться в форумОбщий форумWhy Still WA???? May You SAY...? Послано Pasha 1 дек 2002 11:45 HI Here is my Solution for 1027# by PASCAL What i dont see still? Please Help Me Thanx Sincerely Aidin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` var t1,t2 :char; ans :integer; comment,mark :boolean; procedure solve; begin repeat t2:=t1; read(t1); if comment and (t2='*') and (t1=')') then comment:=false else if not comment then begin if (t2='(') and (t1='*') then begin dec(ans); comment:=true; t1:='Z'; end else if not comment then case t1 of '(': inc(ans); ')': begin dec(ans); if (ans<0) then begin mark:=true; exit; end; end; end; end; until eof; end; begin comment:=false; mark:=false; ans:=0; t1:='0'; solve; if mark or comment or (ans<>0) then writeln('NO') else writeln('YES') end. Re: Why Still WA???? May You SAY...? Послано Pasha 1 дек 2002 12:04 I know: (()) ---> YES (*) ----> No and sometest else could anyone tell me more testcase that he guess fall me in mistake? |
|
|