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
3. Find the product of (a² +3a+5) x (a+7)​
sergij07 [2.7K]

Explanation:

(a^2 + 3a +5) × (a + 7)

= a^3 + 7a^2 + 3a^2 + 21a + 5a + 35

= a^3 + 10a^2 + 26a + 35

3 0
3 years ago
How are modern computers different from eniac?
Natalka [10]
Modern computers use in side a memory board to store info but back then you would use flappy disks   
8 0
3 years ago
When using for loops and two-dimensional arrays, the outside loop moves across the ___________ and the inside loop moves across
lana66690 [7]

Answer: rows, columns

Explanation: :)

6 0
3 years ago
4. What two important events occurred early in the formation of the universe?
Annette [7]
C. When they separated it created the big bang
4 0
3 years ago
My laptop volume has got really low all of a sudden. It wasn't the best to start with but now i can barely even hear it at 100%.
nadezda [96]

Answer:

make sure the speaker is clean and you volume setting is on normal there is alot of setting for deaf people so make sure that is correctly

4 0
3 years ago
Other questions:
  • Which is not an example of a boolean operator?
    6·2 answers
  • Does anyone have any social media message me
    14·1 answer
  • One reason for using social media is to develop social and professional contacts. True or false?
    9·2 answers
  • One software license model allows software to be freely distributed, downloaded, and installed without paying a license fee but
    15·1 answer
  • describe a situation in which peer pressure could cause a serious problem for safe driving, and how you could resist the peer pr
    8·2 answers
  • Multiple Choice: We have been assigned the task of developing a software testing tool (tester) that can assess reachability of s
    11·1 answer
  • You can use this keyboard shortcut to toggle the visibility of the command line. If for some reason your command line is hidden
    7·1 answer
  • The microprogram counter (MPC) contains the address of the next microcode statement for the Mic1 emulator to execute. The MPC va
    12·1 answer
  • 6.23 Lab training: Unit tests to evaluate your program Auto-graded programming assignments may use a Unit test to test small par
    13·1 answer
  • What are common considerations businesses need to make before purchasing new computers? Check all of the boxes that apply.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!