1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ANTONII [103]
4 years ago
5

c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive

by one, sequentially (as their heights appear in A). For the i-th student, if there is a row in which all the students are taller than A[i], the student will stand in one of such rows. If there is no such row, the student will create a new row. Your task is to find the minimum number of rows created.
Computers and Technology
1 answer:
Lilit [14]4 years ago
4 0

The below code will help you to solve the given problem and you can execute and cross verify with sample input and output.

#include<stdio.h>

#include<string.h>

 int* uniqueValue(int input1,int input2[])

 {

   int left, current;

   static int arr[4] = {0};

   int i      = 0;

     for(i=0;i<input1;i++)

      {

         current = input2[i];

         left    = 0;

         if(current > 0)

         left    = arr[(current-1)];

      if(left == 0 && arr[current] == 0)

       {

       arr[current] = input1-current;

       }

       else

   {

       for(int j=(i+1);j<input1;j++)

       {

           if(arr[j] == 0)

           {

               left = arr[(j-1)];

               arr[j] = left - 1;

           }

       }

   }

}

return arr;

}

You might be interested in
Tạo thủ tục có tên _Pro04 để trả về số lượng tổng thời gian tham gia dự án Y của nhân viên có mã số X, với X là tham số đầu vào,
kompoz [17]

Answer:

nigro

Explanation:

6 0
3 years ago
5. Name the special window that displays data, when you insert a chart.
AVprozaik [17]

Answer:

A.Datasheet

Explanation:

I hope it's helpful

7 0
3 years ago
5. The value of a variable
Volgvan

Answer:

It's true .

The value of a variable

cannot be changed during

program execution.

6 0
4 years ago
For a string s ∈ {0, 1} let denote the number represented by in the binary * s2 s numeral system. For example 1110 in binary has
Bogdan [553]

4657879790989o689ok,vm vm  vjl478o78o7t8o78o8y;l. ,nmhnjser467iu56uy56uh by

7 0
3 years ago
What does this program does?
tester [92]
Peoples from around the world help you answer the question you have.
4 0
4 years ago
Other questions:
  • Which statements about Excel's FV function are correct?
    13·1 answer
  • A(n) ________ is installed on your computer, and when the program is opened, your e-mail is downloaded to your computer. web-bas
    14·1 answer
  • The overall purpose of CSS is to modify the way web pages look without modifying the underlying HTML code. way tables render in
    12·2 answers
  • To edit the text in a smartart graphic, what must be done first ?
    7·2 answers
  • Private sharing model on Opportunities. Leadership has asked the Administrator to create a new custom object that will track cus
    7·1 answer
  • _____ is a technique in which computers are designed with many microprocessors that work together, simultaneously, to solve prob
    15·1 answer
  • A network administrator has configured a router for stateless DHCPv6 operation. However, users report that workstations are not
    13·1 answer
  • Web design and development tools
    13·1 answer
  • after confirming the removal of a virus from a computer, how should the technician ensure and verify the full functionality of t
    7·1 answer
  • The value of a variable can change multiple times during the execution of a computer program.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!