这题可害苦了我
最后用了大哥的代码才过的

Diverse String

#include<iostream>
#include<cstdio>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
int T;
string s;
cin>>T;
while(T--)
{
cin>>s;
sort(s.begin(),s.end());
bool flag=true;
for(int i=1;i<s.size();i++)
{
if(s[i]!=s[i-1]+1){
puts("NO");
flag=false;
break;
}
}
if(flag)
puts("Yes");
}
return 0;
}

codeforces-5的更多相关文章

  1. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  2. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  3. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

  4. 【Codeforces 738A】Interview with Oleg

    http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...

  5. CodeForces - 662A Gambling Nim

    http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...

  6. CodeForces - 274B Zero Tree

    http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...

  7. CodeForces - 261B Maxim and Restaurant

    http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...

  8. CodeForces - 696B Puzzles

    http://codeforces.com/problemset/problem/696/B 题目大意: 这是一颗有n个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...

  9. CodeForces - 148D Bag of mice

    http://codeforces.com/problemset/problem/148/D 题目大意: 原来袋子里有w只白鼠和b只黑鼠 龙和王妃轮流从袋子里抓老鼠.谁先抓到白色老鼠谁就赢. 王妃每次 ...

  10. CodeForces - 453A Little Pony and Expected Maximum

    http://codeforces.com/problemset/problem/453/A 题目大意: 给定一个m面的筛子,求掷n次后,得到的最大的点数的期望 题解 设f[i]表示掷出 <= ...

随机推荐

  1. Gym 100963B

    Gym 100963B啊,郁闷,就tm调小了一点范围就A了,就写dp和贪心比较一下,范围到最大值的二倍-1就好了假设最大值的2倍以内能满足最优条件,当金额范围超过最大值2倍的时候:至于为什么,还不清楚 ...

  2. LeetCode 929.Unique Email Addresses

    Description Every email consists of a local name and a domain name, separated by the @ sign. For exa ...

  3. FZU 2285 迷宫寻宝

    思路: bfs求最短路径. #include<stdio.h> #include<iostream> #include<queue> #include<cst ...

  4. C# 集合已修改 可能无法执行枚举操作 zz

    今天编写程序时 修改了list集合 在foreach时报 “集合已修改:可能无法执行枚举操作.”错误. 首先想到的是没有锁定集合对象. 增加了 private readonly object sync ...

  5. Object 中 equals()使用

    详细看: https://www.cnblogs.com/naihuangbao/p/9445027.html 1. ==是判断两个变量或实例是不是指向同一个内存空间equals是判断两个变量或实例所 ...

  6. 修改input和textarea的placeholder的颜色,限制文本框字数输入

    <style type="text/css"> textarea{ width: 400px; height:400px; resize: none; } .limit ...

  7. 【并查集缩点+tarjan无向图求桥】Where are you @牛客练习赛32 D

    目录 [并查集缩点+tarjan无向图求桥]Where are you @牛客练习赛32 D PROBLEM SOLUTION CODE [并查集缩点+tarjan无向图求桥]Where are yo ...

  8. Oracle Sequence创建与使用

    一.Sequence简介 Sequence是数据库系统按照一定的规则自动增加的数字序列,主要用于生成数据库数据记录.这个序列一般作为代理主键(因为不会重复). Sequence是数据中一个特殊存放等差 ...

  9. oracle根据身份证号码 计算年龄、性别

    一.Oracle根据身份证判断性别: 女生身份证: 431382198103246985 男生身份证: 150921197208173492 SQL语句如下:   select decode(mod ...

  10. SSH集成(Struts+Spring+Hibernate)

    环境:struts2.3.Xspring4.0.0hibernate4.2 思路:从下开始往上集成;层与层之间没有关系;在集成的时候,只关注当前集成的那个层的内容; 1,创建一个空的web项目;重新定 ...