subject

Read in an n*m matrix with binary value and output the number of number 1 in each column. Input format:
The first row contains two integers n, m
Then n rows, m integers per row of value 0 or 1

Output format:
m integers, one per line. Each number represents the count of 1 in the corresponding column.

Sample input:
3 5
0 0 1 1 0
0 1 1 0 1
1 0 0 1 0

Sample output:
1
1
2
2
1

Sample input:

5 8

1 1 1 0 0 1 0 1

0 0 1 1 1 0 1 1

1 0 0 1 1 0 1 0

0 0 0 0 1 1 1 1

0 0 1 1 1 1 1 0

HEL PLEASE

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:10
Suppose we have a byte addressable computer that has a 32-byte cache with 8 bytes per block. the memory address is 8 bits long. the system accesses memory addresses (in hex) in this exact order: 6e, b9, 17, e0, 4e, 4f, 50, 91, a8, ab, ad, 93, and 94. (a) assuming the cache is direct mapped, what memory addresses will be in cache block 2 after the last address has been accessed? (b) assuming the cache is direct mapped, what is the hit ratio for the entire memory reference sequence given, assuming the cache is initially empty? (c) assuming the cache is 2-way set associative with a lru replacement policy, what is the hit ratio?
Answers: 3
question
Computers and Technology, 23.06.2019 06:20
What is a point-in-time measurement of system performance?
Answers: 3
question
Computers and Technology, 24.06.2019 12:30
Nikki sent flyers in the mail to all houses within the city limits promoting her computer repair service what type of promotion is this and example of
Answers: 1
question
Computers and Technology, 24.06.2019 21:40
Assume you need to test a function named inorder. the function inorder receives three int arguments and returns true if and only if the arguments are in non-decreasing order: that is, the second argument is not < the first and the third is not < the second. write the definition of driver function testinorder whose job it is to determine whether inorder is correct. so testinorder returns true if inorder is correct and returns false otherwise. for the purposes of this exercise, assume inorder is an expensive function call, so call it as few times as possible!
Answers: 1
You know the right answer?
Read in an n*m matrix with binary value and output the number of number 1 in each column. Input fo...
Questions
question
Mathematics, 09.11.2020 23:40
question
History, 09.11.2020 23:40
question
Mathematics, 09.11.2020 23:40
question
Mathematics, 09.11.2020 23:40
question
History, 09.11.2020 23:40
question
Arts, 09.11.2020 23:40
Questions on the website: 13722362