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]
2 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]2 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
William found out that someone used his report on American culture without his permission. What is William a victim of?
Mnenie [13.5K]

He is a victim of plagiarism.

Plagiarism is when someone steals someone else's work, to help benefit themselves. Taking credit for the other person work.

Hope this helps!

3 0
4 years ago
Read 2 more answers
What item on a business card is generally the most prominent?
AveGali [126]
The most prominent
Company name that's most important
3 0
3 years ago
Read 2 more answers
What is an audit trail?
rewona [7]

Answer:

poop

Explanation:

poop

3 0
3 years ago
Read 2 more answers
A _____ is an electronic path over which data can travel.
vazorg [7]
A bus is an electrical path which data travels between the different components in an electronic device.                                                                      
5 0
4 years ago
Heuristics are not always completely accurate.<br><br><br> Correct or wrong?
Alisiya [41]

Answer:

They are not always right or the most accurate.

Explanation:

Judgments and decisions based on heuristics are simply good enough to satisfy a pressing need in situations of uncertainty, where information is incomplete.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which type of topology describes the physical arrangement, installation, and connection of cables, computer, and other devices?
    10·2 answers
  • What is an extrinsic value? A. something that is valuable in and of itself B. something that is valuable because it leads to ano
    12·1 answer
  • What command would you run from a windows command line to test a computer's network stack?
    7·1 answer
  • Pls help! ive been looking everywhere online but I couldn't find the answer to this:
    5·1 answer
  • Objects falling through air experience a type of friction called.. A.terminal velocity B.air resistance C.rolling friction
    8·1 answer
  • Which of the following attributes of a website indicates a more reliable source for information?
    8·1 answer
  • What's a good app that solves trigonometry problems?
    8·1 answer
  • Write an app that reads an integer, then determines and displays whether the integer is odd or even. [Hint: Use the remainder op
    10·1 answer
  • Write the functions of F1 to F12 on the keyboard​
    5·2 answers
  • Which of these commands is found by default on the quick access toolbar 1)save 2)new 3)open 4)print
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!