zoukankan      html  css  js  c++  java
  • 【codeforces 520A】Pangram

    【题目链接】:http://codeforces.com/problemset/problem/520/A

    【题意】

    给你一个字符串.
    统计里面有没有出现所有的英文字母->’a’..’z’
    每个字母大小写都接受

    【题解】

    用map写就好;
    看看’A’或’a’以及’B’或’b’…有没有出现;
    同时没出现的话就返回false;

    【完整代码】

    #include <bits/stdc++.h>
    using namespace std;
    #define lson l,m,rt<<1
    #define rson m+1,r,rt<<1|1
    #define LL long long
    #define rep1(i,a,b) for (int i = a;i <= b;i++)
    #define rep2(i,a,b) for (int i = a;i >= b;i--)
    #define mp make_pair
    #define ps push_back
    #define fi first
    #define se second
    #define rei(x) scanf("%d",&x)
    #define rel(x) scanf("%lld",&x)
    #define ref(x) scanf("%lf",&x)
    
    typedef pair<int, int> pii;
    typedef pair<LL, LL> pll;
    
    const int dx[9] = { 0,1,-1,0,0,-1,-1,1,1 };
    const int dy[9] = { 0,0,0,-1,1,-1,1,-1,1 };
    const double pi = acos(-1.0);
    const int N = 110;
    
    map <char, int> dic;
    int n;
    char s[N];
    
    int main()
    {
        //freopen("F:\rush.txt", "r", stdin);
        rei(n);
        scanf("%s", s + 1);
        rep1(i, 1, n)
            dic[s[i]] = 1;
        for (char a = 'a', A = 'A'; a <= 'z'&&A <= 'Z'; a++, A++)
            if (dic[a] | dic[A])
                continue;
            else
                return puts("NO"), 0;
        puts("YES");
        //printf("
    %.2lf sec 
    ", (double)clock() / CLOCKS_PER_SEC);
        return 0;
    }
  • 相关阅读:
    ClouderaManager与CDH
    教辅的组成
    国家集训队 小Z的袜子
    国家集训队 旅游
    NOIP2015 子串
    数颜色
    间谍网络
    NOIP2017 逛公园
    APIO2009 抢掠计划
    JLOI2014 松鼠的新家
  • 原文地址:https://www.cnblogs.com/AWCXV/p/7626485.html
Copyright © 2011-2022 走看看