fork(1) download
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. int n ;
  8. cin>>n;
  9. int x ; cin>>x;
  10. vector<vector<int>>mat(n,vector<int>(n,0));
  11. for(int i = 0 ; i<n;i++){
  12. for(int j = 0; j<n;j++){
  13. cin>>mat[i][j];
  14. }
  15. }
  16.  
  17. int count = 0 ;
  18. for(int i = 0 ; i<n;i++){
  19. for(int j = 0; j<n;j++){
  20. if(mat[i][j]<=x){
  21. count++;
  22. }
  23. }
  24. }
  25. cout<<count;
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5284KB
stdin
3
10
1 2 11
5 7 12
10 14 15
stdout
5