/* Abhishek Jaiswal */
#include <bits/stdc++.h>
using namespace std;
const long long MOD=1e9+7;
#define ll long long int
#define vi vector<int>
#define vl vector<long long int>
#define pi pair<int,int>
#define vpi vector<pair<int,int>>
#define vvi vector<vector<int>>
#define vvl vector<vector<long long int>>
#define umps unordered_map<int, unordered_set<int>>
#define pb push_back
#define fo(i,a, n) for (int i = a; i < n; i++)
#define fo_(i,a, n) for (int i = a; i > n; i--)
void solve() {
int h,w; cin>>h>>w;
vector<vector<char>> input(h, vector<char> (w));
unordered_map<char,int> mp;
fo(i,0,h){
fo(j,0,w){
char c; cin>>c;
if(c=='.') continue;
else mp[c]++;
}
}
cout<<mp.size()<<endl;
}
// check if single Testcase is present && overflow && edgecases
int main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// int t = 1; cin >> t;
// for (int i = 1; i <= t; i++){
// cout <<"Case #"<<i<<": ";
solve();
// }
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |