You are writing your first website and seem to be making your fair share of
simple HTML syntax errors. You have decided to write an HTML parser to help
you determine if your HTML code is syntactically correct based on the
following condensed HTML definition:
HTML CODE | BODY | |||
BODY | TEXT | |||
TEXT | STRING | STRING TEXT | TAG | TAG TEXT | |||
STRING | possibly empty string of printable characters other than '<' and '>') | |||
TAG | BOLD | ITALICS | LINK | |||
BOLD | TEXT | |||
ITALICS | TEXT | |||
LINK | URL>TEXT | |||
URL | http://STRING.com Input FormatThe first line contains a single integer n indicating the number of
Output Format
Sample Input 13 <HTML><BODY><B>Hello world!</B></BODY></HTML> <HTML><BODY><B>Is this correct?</B></HTML> <HTML><BODY><A HREF=http://www.go.com>link</A></BODY></HTML> Sample Output 1Syntax Included No Syntax Included Syntax Included HintsProblem SourceMigrated from old NTUJ. Subtasks
Testdata and Limits |