You have n warehouses and n shops. At each warehouse, a truck is loaded with enough goods to supply one shop. There are m roads, each going from a warehouse to a shop, and driving along the ith road takes d i hours, where d i is an integer. Design a polynomial time algorithm to send the trucks to the shops, minimising the time until all shops are supplied.

Answers

Answer 1

Following are the steps of the polynomial-time algorithm:

Split the routes according to their categorizationAssuming that mid = di of the middle road, low = road with the least di, and high = road with the highest di, we may do a binary search on the sorted list.All shops must be approachable only using these roads for every road, from low to mid.Check if all shops can be reached from[tex]\bold{ low \ to\ mid+1}[/tex] using only these roads.There is a solution if every shop can be reached by road only up to [tex]\bold{mid+1}[/tex], but not up to mid.You can [tex]\bold{set \ low = mid+1}[/tex] if all businesses aren't accessible using both [tex]\bold{mid\ and\ mid+1}[/tex] roads.If every shop could be reached using both mid and mid+1, then set high to mid-1.With these layouts of businesses and roads, no response can be given because [tex]\bold{ low > high}[/tex]You can do this by [tex]\bold{set\ mid = \frac{(low + high)}{2}}[/tex]The new low, mid, and high numbers are used in step (a).

In a minimum amount of time, this algorithm will determine the best strategy to supply all shops.

Learn more:

polynomial-time algorithm: brainly.com/question/20261998


Related Questions

Which of these is a tool for creating mobile apps?

Appy Pie

C#

Apple Pie

C++

Answers

Answer:

C++

Explanation:

C++ is used in application development

During the data transmission there are chances that the data bits in the frame might get corrupted. This will require the sender to re-transmit the frame and hence it will increase the re-transmission overhead. By considering the scenarios given below, you have to choose whether the packets should be encapsulated in a single frame or multiple frames in order to minimize the re-transmission overhead.

Justify your answer with one valid reason for both the scenarios given below.

Scenario A: Suppose you are using a network which is very prone to errors.

Scenario B: Suppose you are using a network with high reliability and accuracy.

Answers

The packets would be encapsulated in single frame in scenario A. In scenario B, it should be in multi frames.

In scenario A, given that this network has been said to be prone to error, the packets should be encapsulated in single frames.

The reason for this is because, using a single frame helps to decrease error. We have been told already that it is prone to error. If you use the multi frame, there would be very high likelihood of errors occurring.

In scenario B, given that the network is accurate and very reliable, the best packet is the multi frame.

It would give a quicker transmission and the likelihood of errors occurring is also low.

Read more on https://brainly.com/question/24373056?referrer=searchResults

An engineer is designing an HTML page and wants to specify a title for the browser tab to display, along with some meta data on what tools the page should use. These items would best fit in which of the following sections

a. The element
b. The element
c. The

element
d. The

element

Answers

An HTML is made up of several individual tags and elements such as the head, body. form, frame and many more.

In an HTML page, the meta element and the title element are placed in the head element.

An illustration is as follows:

< head >

< title > My Title < /title >

 < meta charset="UTF-8" >

< / head >

The head element contains quite a number of elements and tags; some of them are:

metatitle stylescriptbase

And so on.

Hence, in order to use a meta-data element, the meta element has to be placed within the head element.

Read more about HTML elements at:

https://brainly.com/question/4484498

How to use the AI System ?

Answers

ANSWER:

· New artificial intelligence systems are being developed to help teachers administer more effective testing that could uncover some of these often-hidden conditions. Once they can be properly identified, educators can tap into the resources available for a learning disability. Students can use AI to give reliable feedback.

What is the iterative procedure of recursive and nonrecursive?

Answers

Answer:

nonrecursive

Explanation:

Your location has been assigned the 172.149.254.0 /24 network. You are tasked with dividing the network into 13 subnets with the maximum number of hosts possible on each subnet.

Required:
a. What is the dotted decimal value for the subnet mask?
b. How many additional bits will you need to mask in the subnet mask?

Answers

The subnet mask would be a 32-bit integer which is formed by assigning the host bits to all 0's and the networking bits to so many 1's.In this method, the subnetting separates the IP address between host and network addresses.The subnet mask covers an IP address with its 32-bit number, thus the term "mask".

Given:

Network IP address [tex]\bold{= 172.149.254.0 /24}[/tex]

Subnet numbers [tex]\bold{= 13}[/tex]

Calculating the borrow bits:

[tex]\to \bold{= ceil(\log_{2} 13) = 4 \ bits}[/tex]

a)

Calculating the dotted decimal value for the subnet mask:

[tex]\to \bold{11111111.11111111.11111111.00000000}\\\\\to \bold{255.255.255.240}\\\\[/tex]

b)

The additional bits which will be needed to mask the subnet mask that is = 4.

Learn more: brainly.com/question/2254014

advantages of computational skill

Answers

Explanation:

algorithmic thinking - developing a set of instructions or sequence of steps to solve a problem;

evaluation - ensuring a solution is fit-for-purpose;

decomposition - breaking a problem down into its component parts;

What is system software? Write its types.​

Answers

Answer:

There are two main types of software: systems software and application software. Systems software includes the programs that are dedicated to managing the computer itself, such as the operating system, file management utilities, and disk operating system (or DOS)

Answer:

There are two main types of software: systems software and application software. Systems software includes the programs that are dedicated to managing the computer itself, such as the operating system, file management utilities, and disk operating system (or DOS)

Explanation:

thanks for question

Imagine that you wanted to write a program that asks the user to enter in 5 grade values. The user may or may not enter valid grades, and you want to ensure that you obtain 5 valid values from the user. Which nested loop structure would you use?
A. A "for" loop inside of a "while" loop
B. A "while" loop inside of a "for" loop
C. None of the above
D. Either a or b would work

Answers

The type of nested loop which I would use to write the program is:

B. A "while" loop inside of a "for" loop

What is a Loop?

This refers to the control flow statement which is used to iterate and lets a particular line(s) of code execute repeatedly

With this in mind, we can see that the type of nested loop which I would use to write the program is a "while" loop inside of a "for" loop because it is a conditional statement that continues to ask for the certain valid grades until it gets the right one.

Therefore, the correct answer is option B

Read more about loops here:
https://brainly.com/question/26098908

Neymar machine that Run on electricity

Answers

"Neymar" = "name a"?

if so, well, there are many, like the little glowing box you use the type questions to the brainliest community, let it be a phone, a pc, or a molded Nintendo

if you meant Neymar indeed, I'm not sure if he runs on electricity, unless he is a soccer playing android somehow.

Marco travels often and does not have consistent wireless Internet service. He frequently uses his mobile phone service to provide Internet access to his tablet.

Which network type is Marco using?


LAN


PAN


WAN


MAN

Answers

Answer:

PAN

Explanation:

For wireless devices like laptops, tablets, wireless desktops, and cellphones to communicate, a wireless LAN normally has a Wi-Fi router or wireless access point. A wireless LAN is essentially a LAN that doesn't use cables. Thus, option B is correct.

What are the PAN  network type is Marco using?

The computer network that links computers and other devices within a specific person's range is known as a personal area network (PAN). PAN stands for personal area network and gives a network range within a person's range, often within a range of 10 meters (33 feet).

A PAN is a network that primarily serves a tiny space, usually a single small room. It allows computer devices to share data and information with other nearby computers.

Therefore, Whereas in LAN, computers are connected via a network over a short distance, such as within a building, or in a single computer network made up of several computers.

Learn more about network type here:

https://brainly.com/question/29515062

#SPJ2

If every company is now a technology company, then what does this mean for every student attending a business college

Answers

Answer:

Explanation:

There are all sorts of possibilities for, say, inserting new technologies into existing processes. But most of these improvements are incremental. They are worth doing; in fact, they may be necessary for survival. No self-respecting airline, for instance, could do without an application that lets you download your boarding pass to your mobile telephone. It saves paper, can't get lost and customers want it.

But while it's essential to offer applications like the electronic boarding pass, those will not distinguish a company. Electronic boarding passes have already been replicated by nearly every airline. In fact, we've already forgotten who was first.

Identify the statement about Windows tasks that is FALSE.


To launch an application, click the Windows icon, select "All Programs," and then click an application.


The boot process is the process for powering off a computer.


A common way to shut down the computer’s operating system is by using the Start menu.


Users log into their accounts on the Welcome screen, before Windows is ready to use.

Answers

The statement about Windows tasks that is FALSE is

The boot process is the process for powering off a computer.

According to the question, we are to discuss about Windows tasks and how it works as regards to the computer.

As a result of this we can see that  in launching an application;

we need to click on Windows iconselect "All Programs," click an application.

Therefore, The boot process is not the process for powering off a computer.

Learn more about Windows tasks .

https://brainly.com/question/1594289

The statement that is false is: The boot process is the process for powering off a computer, which is the second option. The boot process is actually the process of starting or powering on a computer, not powering it off.

The boot process refers to the sequence of events that occur when a computer is powered on or restarted. It is the process of starting up the computer's hardware and loading the operating system into memory so that it is ready for use. During the boot process, the computer's firmware (such as the BIOS or UEFI) performs a series of checks and tests to ensure that the hardware components are functioning correctly. It then searches for the operating system on connected storage devices, such as the hard drive or solid-state drive, and loads it into memory.

Learn more about the boot process here.

https://brainly.com/question/24355262

#SPJ6

Write a recursive function named is_decreasing that takes as its parameter a list of numbers. It should return True if the elements of the list are strictly decreasing (each element in the array is strictly less than the previous one), but return False otherwise.

Answers

Answer:

c

Explanation:

An engineer is configuring AMP for endpoints and wants to block certain files from executing. Which outbreak control method is used to accomplish this task

Answers

Question Completion with Options:

A. device flow correlation

B. simple detections

C. application blocking list

D. advanced custom detections

Answer:

The outbreak control method that is used to accomplish the task of configuring AMP for endpoints and to block certain files from executing is:

C. application blocking list

Explanation:

The application blocking list creates a list of application files, which the AMP continuously tracks and analyzes to compare the file activities with previous cyber attacks.  Specifically, the AMP for Endpoints is a cloud-managed endpoint security solution, which provides a retrospective alert to prevent cyber-security threats, and rapidly detects, contains, and remediates malicious files on the endpoints.

continuously tracks and analyzes files and file activities across your systems, and compares these events to what preceded or happened in past attacks. If a file exhibits malicious behavior, the AMP provides you with a retrospective alert which enables you to stop a potential threat from succeeding.

Irene llegó tarde al colegio_______________
ayúdenme


^_^^_^^_^^_^^_^^_^^_^^_^^_^​

Answers

Answer:

Explanation:

Absconding

To nest one structure within another structure, you a. define both structures and then create a data member of the nested structure type within the other structure b. create a container that holds objects of the nested structure type and then include the container within another structure c. define the nested structure within another structure

Answers

Answer:

Hence the correct option is option a) define both structures and then create a data member of the nested structure type within the other structure.

Explanation:

To make Address nested to Employee, we've to define Address structure before and out of doors Employee structure and make an object of Address structure inside Employee structure.

For example, we may need to store the address of an entity employee in a structure.

How do i connect WiFi on windows xp without icon?

Answers

Right click anywhere on your taskbar, and then click Properties. Step 2: Find and click the Notification Area tab on the top bar, and then find the section labeled with System icons, check the checkbox for Network. Last, click OK to finish it.

Answer:

Right click anywhere on your taskbar, and then click Properties. Step 2: Find and click the Notification Area tab on the top bar, and then find the section labeled with System icons, check the checkbox for Network. Last, click OK to finish it.

cho dãy số a[] có n phần tử và dãy số b[]cõ m phần tử là các các số nguyên dương nhỏ hơn 1000 . Gọi tập hợp A là tập các số khác nhau trong a[], tập hợp B là các số khác nhau trong b[]

Answers

Answer:

please translate

Thank you✌️

(viii) Word does not allow you to customize margins.
true/false:-​

Answers

In Word, each page automatically has a one-inch margin. You can customize or choose predefined margin settings, set margins for facing pages, allow extra margin space to allow for document binding, and change how margins are measured.

I would say false

Help Pls
I need about 5 advantages of E-learning​

Answers

Answer:

Explanation:

E-learning saves time and money. With online learning, your learners can access content anywhere and anytime. ...

E-learning leads to better retention. ...

E-learning is consistent. ...

E-learning is scalable. ...

E-learning offers personalization.

Answer:

E- learning saves time and money

E-learning makes work easier and faster

E- learning is convenient

E- learning is consistent

E- learning is scalable

Explanation:

when you learn using the internet, you save a lot of time by just typing and not searching through books

You are going to purchase (2) items from an online store.
If you spend $100 or more, you will get a 10% discount on your total purchase.
If you spend between $50 and $100, you will get a 5% discount on your total purchase.
If you spend less than $50, you will get no discount.
Givens:
Cost of First Item (in $)
Cost of Second Item (in $)
Result To Print Out:
"Your total purchase is $X." or "Your total purchase is $X, which includes your X% discount."

Answers

Answer:

Code:-

using System;

using System.Collections.Generic;

class MainClass {

public static void Main (string[] args) {

int Val1,Val2,total;

string input;

double overall;

Console.Write("Cost of First Item (in $)");

      input = Console.ReadLine();

Val1 = Convert.ToInt32(input);

Console.Write("Cost of Second Item (in $)");

      input = Console.ReadLine();

Val2 = Convert.ToInt32(input);

total=Val1+Val2;

if (total >= 100)

{

overall=.9*total;

Console.WriteLine("Your total purchase is $"+overall);

}

else if (total >= 50 & total < 100)

{

overall=.95*total;

Console.WriteLine("Your total purchase is $"+overall);

}  

else

{

Console.WriteLine("Your total purchase is $"+total);

}  

}

}

Output:

How many cost units are spent in the entire process of performing 40 consecutive append operations on an empty array which starts out at capacity 5, assuming that the array will grow by a constant 2 spaces each time a new item is added to an already full dynamic array

Answers

Answer:

Explanation:

260 cost units, Big O(n) complexity for a push

Ellen is working on a form in Access and clicks on the Design tab in the Form Design Tools section. Ellen then clicks on the Controls button and clicks the Label icon. What is Ellen most likely doing to the form?
A.adding a title
B.adding an existing field
C.changing the anchoring setting
D.changing the font of a label

Answers

Answer:

D. changing the font of a label

Which is the first computer brought in nepal for the census of 2028 B.S​

Answers

Answer:

The first computer brought in Nepal was IBM 1401 which was brought by the Nepal government in lease (1 lakh 25 thousands per month) for the population census of 1972 AD (2028 BS). It took 1 year 7 months and 15 days to complete census of 1crore 12.5 lakhs population.

Write a Python program stored in a file q1.py to play Rock-Paper-Scissors. In this game, two players count aloud to three, swinging their hand in a fist each time. When both players say three, the players throw one of three gestures: Rock beats scissors Scissors beats paper Paper beats rock Your task is to have a user play Rock-Paper-Scissors against a computer opponent that randomly picks a throw. You will ask the user how many points are required to win the game. The Rock-Paper-Scissors game is composed of rounds, where the winner of a round scores a single point. The user and computer play the game until the desired number of points to win the game is reached. Note: Within a round, if there is a tie (i.e., the user picks the same throw as the computer), prompt the user to throw again and generate a new throw for the computer. The computer and user continue throwing until there is a winner for the round.

Answers

Answer:

The program is as follows:

import random

print("Rock\nPaper\nScissors")

points = int(input("Points to win the game: "))

player_point = 0; computer_point = 0

while player_point != points and computer_point != points:

   computer = random.choice(['Rock', 'Paper', 'Scissors'])

   player = input('Choose: ')

   if player == computer:

       print('A tie - Both players chose '+player)

   elif (player.lower() == "Rock".lower() and computer.lower() == "Scissors".lower()) or (player.lower() == "Paper".lower() and computer.lower() == "Rock".lower()) or (player == "Scissors" and computer.lower() == "Paper".lower()):

       print('Player won! '+player +' beats '+computer)

       player_point+=1

   else:

       print('Computer won! '+computer+' beats '+player)

       computer_point+=1

print("Player:",player_point)

print("Computer:",computer_point)

Explanation:

This imports the random module

import random

This prints the three possible selections

print("Rock\nPaper\nScissors")

This gets input for the number of points to win

points = int(input("Points to win the game: "))

This initializes the player and the computer point to 0

player_point = 0; computer_point = 0

The following loop is repeated until the player or the computer gets to the winning point

while player_point != points and computer_point != points:

The computer makes selection

   computer = random.choice(['Rock', 'Paper', 'Scissors'])

The player enters his selection

   player = input('Choose: ')

If both selections are the same, then there is a tie

   if player == computer:

       print('A tie - Both players chose '+player)

If otherwise, further comparison is made

   elif (player.lower() == "Rock".lower() and computer.lower() == "Scissors".lower()) or (player.lower() == "Paper".lower() and computer.lower() == "Rock".lower()) or (player == "Scissors" and computer.lower() == "Paper".lower()):

If the player wins, then the player's point is incremented by 1

       print('Player won! '+player +' beats '+computer)

       player_point+=1

If the computer wins, then the computer's point is incremented by 1

   else:

       print('Computer won! '+computer+' beats '+player)

       computer_point+=1

At the end of the game, the player's and the computer's points are printed

print("Player:",player_point)

print("Computer:",computer_point)

what is computer? write about computer.​

Answers

Answer:

Is an electronic device used for storing and processing data.

A desktop computer is a type of mobile device.

a. true
b. false

Answers

Answer:B.false
Answer B

A desktop computer is a type of mobile device: B. False.

What is a desktop computer?

A desktop computer simply refers to an electronic device that is designed and developed to receive data in its raw form as an input and processes these data into an output that's usable by an end user.

Generally, desktop computers are fitted with a power supply unit (PSU) and designed to be used with an external display screen (monitor) unlike mobile device.

In conclusion, a desktop computer is not a type of mobile device.

Learn more about desktop computer here: brainly.com/question/959479

#SPJ9

The Janitorial and Cafeteria departments are support departments. Samoa uses the sequential method to allocate support department costs, first allocating the costs from the Janitorial Department to the Cafeteria, Cutting, and Assembly departments. Determine the proportional (percentage) usage of the Janitorial Department by the:

Answers

Complete Question:

Departmental information for the four departments at Samoa Industries is provided below. Total Cost Cost Driver Square Feet Number of employees Janitorial $150,000 square footage serviced 200 Cafeteria 50,000 Number of employees 20,000 Cutting 1,125,000 4,000 120 Assembly 1,100,000 16,000 The Janitorial and Cafeteria departments are support departments Samoa uses the sequential method to allocate support department costs, first allocating the costs Department to the Cafeteria, Cutting and Assembly departments Determine the proportional (percentage) usage of the Janitorial Department by the a. Cafeteria Department b. Cutting Department c. Assembly Department

Answer:

Samoa Industries

Proportional (percentage) usage of the Janitorial Department:

Cafeteria = 50%

Cutting = 10%

Assembly = 40%

Explanation:

a) Data and Calculations:

                 Total Cost         Cost Driver             Square Feet       Number of

                                                                                                    employees

Janitorial   $150,000 Square footage serviced          200                40

Cafeteria      50,000 Number of employees        20,000                 12

Cutting     1,125,000                                                 4,000               120

Assembly 1,100,000                                               16,000                 40

Proportional (percentage) usage of the Janitorial Department:

Cafeteria = 50% (20,000/40,000 * 100)

Cutting = 10% (4,000/40,000 * 100)

Assembly = 40% (16,000/40,000 * 100)

Cost Allocation of the Janitorial Department:

Cafeteria = 50% * $150,000 = $75,000

Cutting = 10% * $150,000 =        15,000

Assembly = 40,% * $150,000 = 60,000

Total =                                    $150,000

A backbone network is Group of answer choices a high speed central network that connects other networks in a distance spanning up to several miles. a group of personal computers or terminals located in the same general area and connected by a common cable (communication circuit) so they can exchange information. a network spanning a geographical area that usually encompasses a city or county area (3 to 30 miles). a network spanning a large geographical area (up to thousands of miles). a network spanning exactly 200 miles with common carrier circuits.

Answers

Answer:

a high speed central network that connects other networks in a distance spanning up to several miles.

Explanation:

A backbone network functions just like the human backbone providing support for network systems by offering a network infrastructure that allows small, high speed internet connectivity. It is a principal data route between large interconnected networks which offers connection services spanning several miles. Most local area networks are able to connect to the backbone network as it is the largest data connection on the internet. This backbone networks are mainly utilized by large organizations requiring high bandwidth connection.

Other Questions
Melinda walked to the mall at 4 miles per hour and then rode back home in a bus at 24 miles per hour. If her total traveling time was 14 hours, how far was it to the mall? The 1950s were a crucial time in the history of Mexican immigration to the United States. Why was this so? friction between two flat surfaces can be divided into two categories. what are the two most common kinds of friction? which policy did the ming dynasty use to unify China following the fall of the yuan dynasty I. . Write the correct forms of the words on brackets to complete the sentences.1. The Japanese eat ____ , so they live for a long time .( HEALTH )2. I think staying at home all day is __________ because I don't know what to do. ( BORE )3 . Many people do volunteer work because it can make a _________ in their community. ( DIFFER )4. . The people in the country are _________________ than the people in the city. ( FRIEND )5.. The water puppetry is performed ____________ in a pool. ( beauty)6. Earth Song is one of his most ____________ songs. (success) 7. It is a pleasure to watch a _________________ performance. ( music) 8.Who is your favourite _____? (sing) 9. It is a good idea to help ________ people in the Philippines. (home).10. My aunt lives in one of the most ______________ parts in Paris.(FASHION) Which graph represents y = |xl?ABCD please answer this question Solve this equation for x. Round your answer to the nearest hundredth. 0.77 = log x The fraction 9/7 is equivalent to? Milestones are usually what?O adjustmentsO intermediate goalsO career goalsO financial goals 6. Write the missing adjectives. (1) Good younger (71) The boy is than him A company has total revenue of $50,000,000, cost of sales of $40,000,000, operating expenses of $5,000,000, and financing costs of $2,000,000. What are earnings per share if the company has 100,000 shares outstanding and no preferred stockholders Derek had a bill of $29 last month on he Call-a-Lot Plan. How many minutes did he use? Frank is a 60- year-old man who is well-loved in his community since he was a boy. He is someone who is outgoing, a party lover, and love to have fun hanging out with peers. Frank is confident about life. From an early age he knew exactly what he wanted to become, and now as a man, he is confident about his career and family and want to leave them a good life when he departs this life. Frank express that he is not afraid of dying but he wants them to be ok when he is gone. At work Frank is helpful to his colleagues, and even in his community he is well-known among the elderly since he is always putting on Christmas treats for them. Imagine that Frank is your colleague, and that your boss asks you to write a character reference for Frank. Using Jungs personality theory to guide your writing, present a minimum one- page character reference in which you spell out Franks behaviour, his outlook on life, his philosophy about people and all the other important things you know about him. Ensure you point out how these different parts of Franks life fits into Jungs theory and overall what Jungs theoretical concept says about him. 1. Mi hermano y yo BLANK en cinco minutos y salimos. (vestirse)2. Por qu BLANK una ensalada? No te gustan las verduras. (pedir)3. En qu mercado BLANK t esas frutas? (conseguir)4. Despus de la cena yo BLANK caf. (servir)5. Anoche mis amigos BLANK comida guatemalteca. (servir)6. El domingo pasado BLANK quedarnos en casa. No salimos. (preferir)7. A qu hora BLANK los chicos anoche? (dormirse)8. Dices que Ana Mara nunca BLANK tu secreto? No lo creo! (repetir)9. En qu ao BLANK el presidente Kennedy? (morir)10. Sebastin no BLANK bien en el tren. (dormir) Find the value x . Question 8(Multiple Choice Worth 5 points) (01.01 MC) Which number line best show how to solve -4 - (-8)? Name and briefly describe the two techniques that canhelp you keep your stress undercontrol A stationer buys a gel pen Rs 20 and sells it at 20% profit.For what price should he buy it so that he can make 25% profit by selling for the same selling price. If a zero is , then the graph of its function only touches the xaxis at that zero.