이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define in insert
#define vll vector<ll>
#define endl "\n"
#define pll pair<ll,ll>
#define all(x) (x).begin() , (x).end()
#define f first
#define s second
#define pr(x) cout<<x<<endl;
#define pr2(x,y) cout<<x<<" "<<y<<endl;
#define pr3(x,y,z) cout<<x<<" "<<y<<endl;
#define prv(v) for(auto x:v) cout<<x<<" ";
#define ffs fflush(stdout);
#define int ll
#define sz(x) (ll)x.size()
using namespace std;
const ll MOD = 1e9+7;
const ll INF = 1e9;
const ll LOG = 29;
#define PI 3.141592653589793238
long long binpow(long long a, long long b) {
a%=MOD;
long long res = 1;
while (b > 0) {
if (b & 1)
res = (res * a);
a = (a * a);
b >>= 1;
}
res%=MOD;
return res;
}
const ll N =(1e6+5);
char grid[4005][4005];
void solve(){
ll n,m;
cin>>n>> m;
set<char> se;
for(int i = 1;i<= n;i++){
for(int j = 1;j <= m;j++){
char c;
cin >> c;
if(c == '.') continue;
se.in(c);
}
}
cout<<sz(se)<<endl;
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
ll t=1;
//cin>>t;
while(t--){
solve();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |