Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define int long long
- using namespace std;
- int32_t main() {
- int k, n, m;
- cin >> k >> n >> m;
- vector<set<int> > res(n);
- while(k--){
- for(int i = 0; i < n; i++){
- string s;
- cin >> s;
- for(int j = 1; j < m; j++){
- if(s[j] != s[j - 1]) res[i].insert(j);
- }
- }
- }
- int ans = 0;
- for(auto &x: res){
- ans += x.size() + 1;
- }
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement