Click Here to go back to the homepage.

ToLower Solution:


#include <bits/stdc++.h>
using namespace std;

int main(){
    // #ifndef TESTING
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    int problems, cases, solved = 0;
    cin >> problems >> cases;
    string word;
    while(problems--){
        bool good = true;
        for(int i = 0; i < cases; i++){
            cin >> word;
            if(good){
                if(any_of(word.begin() + 1, word.end(), ::isupper)){
                    good = false;
                }
            }
        }
        if(good){
            solved++;
        }
    }
    cout << solved << endl;

    return 0;
}