Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- using namespace std;
- int t;
- int main(){
- cin >> t;
- while (t--){
- int n; cin >> n;
- int ones = 0; int odd = 0;
- for (int j = 0; j < n; ++j){
- string s; cin >> s;
- if (s.length() % 2 == 1) odd++;
- for (int i = 0; i < s.length(); ++i){
- if (s[i] == '1') ones++;
- }
- }
- if (ones % 2 == 1 && odd > 0 || ones % 2 == 0)
- cout << n << endl;
- else cout << n - 1 << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment