Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 406 Weeks Ago, 2 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 17 Sep 2017 My Price 6.00

random sub-arrays

The University results for the exams have just been declared. The colleges have received marks of N students. Now the teachers want to form groups of students for a seminar. However they do not want students having same marks in one group. They decide to pick random sub-arrays from the array of marks of N students. The teacher wants to find the number of students having different marks in that sub-array.

 

Input

 

  • The first line of the input contains an integer N denoting the number of students.
  • The second line contains N space-separated integers A1, A2, ..., AN denoting the marks of each student.
  • The third line contains M , the number of sub-arrays picked by the teacher
  • The next M lines each contain two integers denoting the range of the sub-array.

 

Output

 

  • Output M lines containing the answer for each sub-array given by the teacher.

 

Constraints

 

  • 1 = N = 30000
  • 1 = M = 50000
  • 1 = Ai = 100000

 

Example

Input: 6 2 4 5 4 3 7 3 1 3 2 4 6 6 Output: 3 2 1

Answers

(5)
Status NEW Posted 17 Sep 2017 12:09 PM My Price 6.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)