【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;elsereturn puts("NO"), 0;puts("YES");//printf("\n%.2lf sec \n", (double)clock() / CLOCKS_PER_SEC);return 0;
}
转载于:https://www.cnblogs.com/AWCXV/p/7626485.html
【codeforces 520A】Pangram相关推荐
- 【CodeForces - 144C】Anagram Search(尺取,滑窗问题,处理字符串计数)
题干: A string t is called an anagram of the string s, if it is possible to rearrange letters in t so ...
- 【CodeForces - 574B】Bear and Three Musketeers (枚举边,思维,优秀暴力)
题干: Do you know a story about the three musketeers? Anyway, you will learn about its origins now. Ri ...
- 【CodeForces - 608C】Chain Reaction (二分 或 dp ,思维)
题干: 题目大意: 题意是在一条直线上坐落着不同位置的灯塔,每一个灯塔有自己的power level,当作是射程范围.现在从最右边的灯塔开始激发,如果左边的灯塔在这个灯塔的范围之内,那么将会被毁灭.否 ...
- 「一题多解」【CodeForces 85D】Sum of Medians(线段树 / 分块)
题目链接 [CodeForces 85D]Sum of Medians 题目大意 实现一个setsetset,支持插入,删除,求∑a5k+3∑a5k+3\sum a_{5k+3}.注意,setsets ...
- 【CodeForces 997C】Sky Full of Stars(组合计数)
题目链接:[CodeForces 997C]Sky Full of Stars 官方题解:Codeforces Round #493 - Editorial 题目大意:有一个n×nn×nn\times ...
- 【codeforces 812C】Sagheer and Nubian Market
[题目链接]:http://codeforces.com/contest/812/problem/C [题意] 给你n个物品; 你可以选购k个物品;则 每个物品有一个基础价值; 然后还有一个附加价值; ...
- 【codeforces 508B】Anton and currency you all know
[题目链接]:http://codeforces.com/contest/508/problem/B [题意] 给你一个奇数; 让你交换一次数字; 使得这个数字变成偶数; 要求偶数要最大; [题解] ...
- 【codeforces 711B】Chris and Magic Square
[题目链接]:http://codeforces.com/contest/711/problem/B [题意] 让你在矩阵中一个空白的地方填上一个正数; 使得这个矩阵两个对角线上的和; 每一行的和,每 ...
- 【codeforces 807C】Success Rate
[题目链接]:http://codeforces.com/contest/807/problem/C [题意] 给你4个数字 x y p q 要求让你求最小的非负整数b; 使得 (x+a)/(y+b) ...
最新文章
- Windows 7 Natvie VHD
- c++读取txt中每行的数据到数组中
- VS2015中配置MSComm通讯控件和注意事项
- android 字体描边实现,android文字描边功能的实现
- MaxCompute 费用暴涨之新增SQL分区裁剪失败
- python猜词游戏源代码_Python趣味小游戏编写教学
- 人从众!中秋小长假全国铁路预计发送旅客4600万人次
- 在网页中嵌入任意字体(特殊字体/自定义字体)的解决方案
- 计算机系统-电路设计10-寄存器的内部电路实现(输入与输出不同线)
- 【数据挖掘】基于密度的聚类方法 - OPTICS 方法 ( 算法流程 | 算法示例 )
- 使用ACR122U和Proxmark3复制IC卡
- 关于连接PostgreSQL时提示 FATAL: password authentication failed for user 连接用户名 的解决方法...
- 到底要不要去外包公司?这篇带你全面了解外包那些坑!
- Base-calling for next-generation sequencing platforms (译文)
- 服务器无线桥接技巧,服务器无线桥接设置方法
- Block.one的EOS区块链入门开发教程Elemental Battles
- UNITY与Mac⭐一、在苹果电脑上配置 Unity 安卓环境的教程
- 论文《Avoiding Inference Heuristics in Few-shot Prompt-based Finetuning》学习笔记
- 百度地图的鹰眼服务--Web上手
- 服务器和交换机物理连接_利用Calico融合物理网络的云原生容器SDN方案