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
nadya68 [22]
3 years ago
12

Write a function solution that given an array a of n integers (between -100 and 100), returns the sign (-1,0,1) of product of al

l the numbers in the array multiplied
Computers and Technology
1 answer:
JulijaS [17]3 years ago
4 0

left[0]=a[0];

for(int i=1;i<=n-1;i++)

   left[i]=(left[i-1]*a[i])%M;

right[n-1]=a[n-1];

for(int i=n-2;i>=0;i--)

   right[i]=(right[i-1]*a[i])%M;

for query q

   if(q==0)

       return right[1]%M;

   if(q==n-1)

       return left[n-2]%M;

   return (left[q-1]*right[q+1])%M;

You might be interested in
Which technological tool is important for storing critical files?.
Vanyuwa [196]

The technological tools that can be considered important for storing critical files are battery backup systems and drives. These devices can be used to store data and supply energy.

<h3>Battery backup systems</h3>

A home battery backup system is a device used to keep the electrical system working in the event when the electrical source goes down.

In computation, there are three major classes of batteries systems:  Lead-Acid, Nickel-Cadmium, and Lithium-Ion.

An uninterruptible power supply (UPS) can be considered as a battery backup supply capable of charging when the power is on.

Learn more about battery backup systems here:

brainly.com/question/7125266

3 0
2 years ago
Janae started an essay on the computer at school. She would like to work on it when she gets home, but she does not have a flash
Marina86 [1]
A) it would be cloud computing
3 0
4 years ago
Read 2 more answers
Although “dog.jpg” and “dog.JPG” and “Dog.jpg” and “DOG.JPG” all appear to be the same file, they are not considered the same wh
____ [38]
Because of the capitalization; when talking about computer science and programming things have to be very tedious and specific. <span />
5 0
3 years ago
1. What is a word processor program?
serg [7]
A word processor program is a software that can be used to create, edit and print documents.
5 0
1 year ago
Which expansion slot is best for high-end dedicated video cards?
Contact [7]

Solution:

It is done Motherboard.

The motherboard includes most of the slots that we'll run into these days. It's a little unusual in that we don't often see motherboards which have both PCI-Express slots and an AGP slot. The best slot to use for video cards is the PCI-Express x16 slot. The next best is the AGP slot. The next best is a PCI-Express x1 slot but video cards which fit that slot are very hard to find as of late 2006. Some low-budget computers are sold with integrated video and have neither PCI-Express x16 slot or an AGP slot.

3 0
3 years ago
Other questions:
  • Read the description of Mike’s work, and identify his profession. Mike’s job is to record sounds in a studio. He studies a video
    14·2 answers
  • At which layer of the osi model is the entire message referred to as the payload
    15·1 answer
  • What is a service-oriented architecture? Group of answer choices A business-driven enterprise architecture that supports integra
    13·1 answer
  • Your desktop, Internet Explorer®, and the Media Player can be started from this area on most computers.
    10·2 answers
  • Write a program which reads in a single integer 0 &lt;= n &lt; 30 and prints out the factorial of n. Factorials get very big ver
    9·2 answers
  • How to delete a virus that act by restarting u r computer? I am in safe mood to aviod restart.
    10·1 answer
  • Given two variables firstInClass and secondInClass which have already been associated with values, write code which swaps the va
    9·1 answer
  • Michael’s team is presenting a robot before their examiners. What do they need which is a definitive description of the final pr
    6·1 answer
  • Complete the sentence.
    10·1 answer
  • Which of the following are parts of the natural environment? (Select the best four answers.)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!