Skip to main content

Posts

Showing posts from May, 2017
Dani is writing some arrays in her favorite text editor NOTES. Each line of the document describes an array in the following format: Here   is the array's number of elements and   are its contents. Dani wrote   arrays in the file and left for lunch. To her dismay, her little brother Nik deleted all the newline characters from the file while she was gone! For example, consider the file in the table below: Given the contents of Dani's NOTES file with all the newlines removed, find the value of   (i.e., the number of arrays in the initial file). Input Format The first line contains an integer denoting   (the number of integers in the file). The second line contains   space-separated integers describing each respective value in the file. Constraints Output Format Print a single integer denoting  . Sample Input 0 11 5 4 5 4 3 3 2 1 4 1 4 Sample Outpu...