Solved by 1788 users: ...| User | Date | Attempt | Time | CM | SC |
|---|
| xtender | 23 apr 2010 | Perl | 16 | 00.06 | 14 | | | jerom | 13 may 2007 | Perl | 1 | 00.07 | 14 | | | xtender | 23 apr 2010 | Perl | 12 | 00.06 | 15 | | | uru | 17 feb 2009 | Ruby | 13 | 00.36 | 15 | | | xtender | 23 apr 2010 | Perl | 11 | 00.06 | 16 | | | xtender | 23 apr 2010 | Perl | 13 | 00.06 | 16 | | | Nakilon | 24 apr 2010 | Ruby | 8 | 00.02 | 17 | | | xtender | 23 apr 2010 | Perl | 10 | 00.06 | 18 | | | uru | 17 feb 2009 | Ruby | 11 | 00.36 | 19 | | | Asp | 09 nov 2006 | Perl | 5 | 00.06 | 20 | | | sb3ar | 27 jan 2008 | Ruby | 21 | 00.04 | 21 | | | Asp | 08 nov 2006 | Perl | 3 | 00.06 | 24 | | | ret | 08 jan 2010 | Perl | 13 | 00.06 | 24 | | | fetetriste | 01 may 2009 | Ruby | 7 | 00.07 | 24 | | | evg281 | 10 aug 2006 | Perl | 3 | 00.06 | 25 | | | ret | 08 jan 2010 | Perl | 10 | 00.06 | 25 | | | tarc | 05 oct 2009 | Python | 10 | 00.12 | 27 | |
Languages| C++ | 757 | | FPC | 536 | | C | 291 | | Java | 91 | | Kylix | 73 | | Python | 34 | | Ruby | 23 | | Perl | 13 | | Haskell | 5 | | Scheme | 5 | | Lua | 1 | | < < < < < < < < < <
|
|---|
Brackets
Some bracket structures are valid while others are not.
Your task is to determine whether a given bracket structure is valid.
Input contains a word of length at most 4000 consisting of symbols
( and ) only.
Output should be the single word "YES" or "NO" (without quotes).
SAMPLE INPUT #1:
()
SAMPLE OUTPUT #1:
YES
SAMPLE INPUT #2:
)(
SAMPLE OUTPUT #2:
NO
SAMPLE INPUT #3:
()(())()
SAMPLE OUTPUT #3:
YES
Athor:
<PREV | Problem set | Search related messages | NEXT>