Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main(){
- int n, m, k;
- cin >> n >> m >> k;
- vector<int>f(n, 0);
- for(int i = 0; i < n; i++){
- for(int j = 0; j < m; j++){
- int x;
- cin >> x;
- if(x==1){
- f[i] = f[i] | (1 << j);
- }
- }
- }
- map<int, int>mp;
- for(int i = 0; i < n; i++){
- mp[f[i]]++;
- }
- int ans = 0;
- for(auto &[a, b]: mp){
- int x = m - __builtin_popcount(a);
- if(x <= k and (k-x)%2==0){
- ans = max(ans, b);
- }
- }
- cout << ans << endl;
- }
- /*
- 3 3 2
- 1 0 0
- 1 0 1
- 1 0 0
- 2
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement