Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <cmath>
- using namespace std;
- int main()
- {
- long long int n,i,j,m,ma,c;
- cin >> n >> m;
- vector < vector<long long int>> a(n, vector<long long int>(m));
- ma=0;
- c=0;
- for (i=0;i<n;++i)
- for(j=0;j<m;++j){
- cin >> a[i][j];
- if (a[i][j]>ma)
- ma=a[i][j];
- }
- for (i=0;i<n;++i){
- for (j=0;j<m;++j)
- {
- if (a[i][j]==ma)
- {
- ++c;
- break;
- }
- }
- }
- cout<<c;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement