Codeforces Round #295 (Div. 2) A. Pangram

7277 단어 codeforces

제목 주소:http://codeforces.com/contest/520/problem/A
 1 /*  2      3 */  4 #include <cstdio>  5 #include <iostream>  6 #include <algorithm>  7 #include <map>  8 #include <set>  9 #include <cmath> 10 #include <string> 11 #include <cstring> 12 using namespace std; 13 14 int main(void) 15 { 16 //freopen ("A.in", "r", stdin); 17 18 map<char, int> m1; 19 map<char, int> m2; 20 int n; 21 while (~scanf ("%d", &n)) 22  { 23 for (int i=1; i<=26; ++i) 24  { 25 m1[i] = 0; m2[i] = 0; 26  } 27 char s[110]; 28 scanf ("%s", &s); 29 for (int i=0; i<=n-1; ++i) 30  { 31 if (s[i]<='z' && s[i]>='a') 32  { 33 int x = s[i] - 'a' + 1; 34 m1[x]++; 35  } 36 else 37  { 38 int y = s[i] - 'A' + 1; 39 m2[y]++; 40  } 41  } 42 43 bool flag = true; 44 for (int i=1; i<=26; ++i) 45  { 46 if (m1[i] == 0 && m2[i] == 0) 47  { 48 flag = false; break; 49  } 50  } 51 52 (flag) ? puts ("YES") : puts ("NO"); 53  } 54 55 return 0; 56 }

좋은 웹페이지 즐겨찾기