Previous Next
0 / 21
Module DEMO-32-109DEMO-C-32

Count Greater Than K

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Write a program to count the number of elements in a matrix that are strictly greater than a value K. K is provided after the matrix input.

Constraints

1 <= N, M <= 10. Integers within standard range.

Input Format

Input: Dimensions N M followed by the matrix elements.

Output Format

Output: The formatted result as specified.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
2 4
45 7 25 1
13 45 0 35
3
6
6 values are > 3.
Sample #2
Public sample
2 5
5 14 16 5 38
29 -9 42 10 9
8
7
7 values are > 8.
Sample #3
Public sample
5 4
5 -10 14 -10
40 43 -3 19
1 -4 9 20
24 9 44 27
14 -7 38 -4
8
12
12 values are > 8.
Sample #4
Public sample
2 5
34 15 24 32 20
22 3 20 48 -4
1
9
9 values are > 1.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings