Đếm k trong mảng hai chiều

View as PDF



Problem type
Allowed languages
C#, C++, Clang, Clang++, Cobol, D, Groovy, Haskell, Java, JS, Kotlin, Lua, Node JS, ObjectiveC, OCaml, Output, PHP, Prolog, Pypy, Pypy 3, Ruby, Rust, Scala, Swift
Points: 100 Time limit: 1.0s Memory limit: 256M Input: stdin Output: stdout

Cho một bảng số \(a\) nguyên kích thước \(m\cdot n\) và số nguyên \(k\). Hãy đếm xem trong dãy có bao nhiêu phần tử có giá trị \(k\).

Input

  • Dòng 1: Gồm 2 số nguyên dương \(m, n\) và số nguyên \(k\).
  • \(m\) dòng tiếp theo, mỗi dòng gồm \(n\) số

Output

  • Kết quả bài toán

Constraints

  • \(m,n\leq 10^3\)
  • \(|k|\leq 10^3\)
  • \(|a[i][j]|\leq 10^3\)

Example

Test 1

Input
2 3 4
2 4 6
6 4 2
Output
2

Comments

There are no comments at the moment.