-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pangram.cpp
41 lines (37 loc) · 840 Bytes
/
Pangram.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* https://codeforces.com/problemset/problem/520/A
* #string #implementation use a array[26] character
*/
#include<iostream>
#include<vector>
using namespace std;
int main() {
int len = 'z' - 'a' + 1;
int n;
cin >> n;
string str;
cin >> str;
if(str.length() < len) {
cout << "NO" << endl;
}
else {
vector<int> charVt(len);
for (char c : str) {
int idx;
if ('a' <= c && c <= 'z') {
idx = c - 'a';
}
if ('A' <= c && c <= 'Z') {
idx = c - 'A';
}
charVt.at(idx) += 1;
}
for (int val : charVt) {
if (val == 0) {
cout << "NO" << endl;
return 0;
}
}
cout << "YES" << endl;
}
return 0;
}