96762024-02-23 22:14:21999Kert (75 pont)cpp17Partially correct 71/75248ms12596 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() 
{
  int n,m,p;cin>>n>>m>>p;
  int ans1=0,ans2=0;
  vector<vector<int>> v(n,vector<int>(m));
  for(int i = 0;i<n;i++){
    int currn=-1,currl=0,best=0;
    map<int,int> ma;
    for(int j = 0;j<m;j++){
      cin>>v[i][j];
      ma[v[i][j]]++;
      if(v[i][j]==currn)currl++;
      else{
        currn=v[i][j];
        best=max(best,currl);
        currl=1;
      }
    }

    //task 1:
    int temp=0;
    for(auto k:ma){
      temp=max(temp,k.second);
    }
    if(temp>m/2)ans1++;
    ans2=max(ans2,best);
  }  
  cout<<ans1<<endl<<ans2;
}
SubtaskSumTestVerdictTimeMemory
base71/75
1Accepted0/03ms1812 KiB
2Accepted0/0233ms9736 KiB
3Partially correct2/43ms2228 KiB
4Accepted4/43ms2476 KiB
5Partially correct2/43ms2656 KiB
6Accepted4/43ms2892 KiB
7Accepted4/43ms2816 KiB
8Accepted4/43ms2964 KiB
9Accepted4/43ms2892 KiB
10Accepted4/47ms3124 KiB
11Accepted6/63ms3196 KiB
12Accepted6/612ms3596 KiB
13Accepted6/632ms4328 KiB
14Accepted6/6224ms11320 KiB
15Accepted6/6211ms12596 KiB
16Accepted6/6248ms11176 KiB
17Accepted7/7143ms7812 KiB