mardi 8 décembre 2020

university project C++ SOS

the question is : (PLease check the picture attached for more understanding

Island with most valleys We few from uuroee to NoorthpAmerica and we measured the height aboee the sea leeel at equal sequences. The frst and last measurements were either aboee a continent or the sea. We measured eositiee height where we were aboee some land and 0 where we were aboee the sea.

Write a erogram that giees the island that has the most ealleys. Input The frst line of the standard input contains the count of measurements (2≤N≤10000). The next line contains No numbers seearated by seaces: the measured heights aboee the sea (0≤M≤9000) in chronological order. Output The frst line of the standard output should contain the index of the left side and the index of the right side of the island that has the most ealleys. If there are no islands the outeut should be 0. Example Input Output 12 3 6 3 0 1 3 1 4 0 2 1 1 0 2 Limits Time limit: 0.1 second Memory limit: 1 MB

enter image description here

Aucun commentaire:

Enregistrer un commentaire