All submissions for this problem are available.Teja likes cricket very much and likes to watch it all the time, but he is bored of watching the matches alone and asks his friend to give him company. But his friend doesn’t know how to read cricket scores so Teja decided to teach him. To make him understand better Teja gave him a list of scores of an innings of a match. The scores are ordered in the increasing order of time at which it was recorded. In the version of Cricket Teja follows, runs can't be taken away from the batting team and a batsmen is not allowed to bat once he is dismissed, also the innings gets over when the 10th wicket falls or when the required number of overs are completed and no more scores are recorded once an innings get over. Now Teja wants his friend to find out if its a valid score card or not. Since his friend is busy watching football he asks for your help to answer Teja. ###Input: - First line cointains an integer N denoting the number of scores recorded. - Next n line contain two integers Ri and Wi, Ri is the runs scored and Wi is the number of wickets lost. ###Output: print “YES” if it is valid else print “NO” without quotes. ###Constraints - $1 \leq N \leq 10^6$ - $0 \leq Ri \leq 10^7$ - $0 \leq Wi \leq 10$ ###Subtasks - 30 points : $1 \leq N \leq 10^4$ - 70 points : $Original Constraints$ ###Sample Input: 3 1 1 4 1 7 6 ###Sample Output: YES ###Sample Input: 3 1 1 9 1 7 6 ###Sample Output: NO
|Tags||aswinashok44, cakewalk, locapr18|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.