#include <bits/stdc++.h>
#define mem(a, b) memset(a, b, sizeof(a))
using namespace std;
const int maxn = , INF = 0x7fffffff;
string str;
int vis[];
int main()
{
cin>> str;
mem(vis, );
int cnt = , ans = ;
for(int i=; i<str.size(); i++)
vis[str[i] - 'a']++;
for(int i=; i<; i++)
if(vis[i])
{
cnt++;
if(vis[i] >= )
ans++;
if(cnt > )
{
cout<< "No" <<endl;
return ;
}
}
if(cnt == )
{
cout<< "No" <<endl;
}
else if(cnt == )
{
if(ans == )
cout<< "Yes" <<endl;
else
cout<< "No" <<endl;
}
else if(cnt == )
{
if(ans)
cout<< "Yes" <<endl;
else
cout<< "No" <<endl;
}
else if(cnt == )
cout<< "Yes" <<endl; return ;
}

CodeForces - 955B(用char会超时。。。)的更多相关文章

  1. 存储过程参数CHAR传过来null导致超时.

    调用的时候不要传NULL,可以传 '' ALTER PROCEDURE [dbo].[up_UC_GetUCExecuteEPList]          @Code VARCHAR(3) ,--ch ...

  2. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) C (用map 超时)

    C. Bear and Colors time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  3. Codeforces Round #304 (Div. 2)-D. Soldier and Number Game,素因子打表,超时哭晕~~

    D. Soldier and Number Game time limit per test 3 seconds memory limit per test 256 megabytes input s ...

  4. Codeforces Round #451 (Div. 2)-898A. Rounding 898B.Proper Nutrition 898C.Phone Numbers(大佬容器套容器) 898D.Alarm Clock(超时了,待补坑)(贪心的思想)

    A. Rounding time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...

  5. 计数排序 + 线段树优化 --- Codeforces 558E : A Simple Task

    E. A Simple Task Problem's Link: http://codeforces.com/problemset/problem/558/E Mean: 给定一个字符串,有q次操作, ...

  6. dp --- Codeforces 245H :Queries for Number of Palindromes

    Queries for Number of Palindromes Problem's Link:   http://codeforces.com/problemset/problem/245/H M ...

  7. Codeforces Zepto Code Rush 2014 -C - Dungeons and Candies

    这题给的一个教训:Codeforces没有超时这个概念.本来以为1000*(1000+1)/2*10*10要超时的.结果我想多了. 这题由于k层都可能有关系,所以建一个图,每两个点之间连边,边权为n* ...

  8. CodeForces 222B Cosmic Tables

    Cosmic Tables Time Limit:3000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Subm ...

  9. DFS/BFS Codeforces Round #301 (Div. 2) C. Ice Cave

    题目传送门 /* 题意:告诉起点终点,踩一次, '.'变成'X',再踩一次,冰块破碎,问是否能使终点冰破碎 DFS:如题解所说,分三种情况:1. 如果两点重合,只要往外走一步再走回来就行了:2. 若两 ...

随机推荐

  1. day1 post验证登录

    用post方式模拟 1.登录抽屉网 2.登录代码 ,URL,Form Data 中的信息写入 # coding=utf-8 #post 登录验证 import requests form_data = ...

  2. day6 break continue for

    .for .break (整个while循环全部结束) )打印1-100的偶数.py )打印1-100的20个偶数.py )while嵌套中的break (就近原则) .continue 错误用法: ...

  3. 【转】 线段树完全版 ~by NotOnlySuccess

    载自:NotOnlySuccess的博客 [完全版]线段树 很早前写的那篇线段树专辑至今一直是本博客阅读点击量最大的一片文章,当时觉得挺自豪的,还去pku打广告,但是现在我自己都不太好意思去看那篇文章 ...

  4. LVS入门篇(二)之LVS基础

    1. LVS介绍 LVS是Linux虚拟服务器(LinuxVirtualServers),使用负载均衡技术将多台服务器组成一个虚拟服务器.它为适应快速增长的网络访问需求提供了一个负载能力易于扩展,而价 ...

  5. 手撕一个 Galgame 神器——Shub-Niggurath Project

    一.想法 Galgame 我们大概可以分为好用的 Galgame 和好玩的 Galgame,但是如果你把好玩的 Galgame 拿来用的话,有时候会十分让人着急.如果你躺在床上,一只手还在按压键盘实际 ...

  6. Android开发笔记——视频录制播放常见问题

    本文分享自己在视频录制播放过程中遇到的一些问题,主要包括: 视频录制流程 视频预览及SurfaceHolder 视频清晰度及文件大小 视频文件旋转 一.视频录制流程 以微信为例,其录制触发为按下(住) ...

  7. SQL Server 2008 R2 链接 Oracle 10g

    首先sqlserver 链接oracle可以通过两个访问接口: “MSDAORA” 和“OraOLEDB.Oracle” 1.“MSDAORA”访问接口是由Microsoft OLE DB Provi ...

  8. json_encode替代函数

    <?php   function jsonEncode($var) {     if (function_exists('json_encode')) {         return json ...

  9. 英特尔® 实感™ 前置摄像头 SR300 和 F200 的比较

    原文地址 简介 SR300 是支持 Microsoft Windows 10 操作系统的第二代英特尔® 实感™ 前置摄像头. 与 F200 摄像头型号相似,SR300 使用编码光深技术,在更小范围内创 ...

  10. 《零基础学JavaScript(全彩版)》学习笔记

    <零基础学JavaScript(全彩版)>学习笔记 二〇一九年二月九日星期六0时9分 前期: 刚刚学完<零基础学HTML5+CSS3(全彩版)>,准备开始学习JavaScrip ...