Time limit : 2sec / Memory limit : 256MB

Score : 200 points

Problem Statement

Let w be a string consisting of lowercase letters. We will call w beautiful if the following condition is satisfied:

  • Each lowercase letter of the English alphabet occurs even number of times in w.

You are given the string w. Determine if w is beautiful.

Constraints

  • 1≤|w|≤100
  • w consists of lowercase letters (a-z).

Input

The input is given from Standard Input in the following format:

w

Output

Print Yes if w is beautiful. Print No otherwise.


Sample Input 1

Copy
abaccaba

Sample Output 1

Copy
Yes

a occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.


Sample Input 2

Copy
hthth

Sample Output 2

Copy
No

题解:很简单 但是没有考虑长度为一的时候哇了两发
 #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
#include <queue>
#include <stack>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
return b?gcd(b,a%b):a;
}
bool cmp(int x,int y)
{
return x>y;
}
const int N=;
const int mod=1e9+;
int main()
{
std::ios::sync_with_stdio(false);
char a[];
scanf("%s",a);
int len=strlen(a);
if(len==) {
cout<<"No"<<endl;
return ;
}
sort(a,a+len);
int t=,flag=;
for(int i=;i<len;i++){
if(a[i]==a[i-]) t++;
else{
if(t%==) {
flag=;
break;
}
else t=;
}
}
if(flag) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return ;
}

AtCoder Beginner Contest 044 B - 美しい文字列 / Beautiful Strings的更多相关文章

  1. AtCoder Beginner Contest 044 C - 高橋君とカード / Tak and Cards

    题目链接:http://abc044.contest.atcoder.jp/tasks/arc060_a Time limit : 2sec / Memory limit : 256MB Score ...

  2. AtCoder Beginner Contest 044 A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit)

    Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement There is a hotel with ...

  3. AtCoder Beginner Contest 224

    AtCoder Beginner Contest 224 A - Tires 思路分析: 判断最后一个字符即可. 代码如下: #include <bits/stdc++.h> using ...

  4. AtCoder Beginner Contest 173 题解

    AtCoder Beginner Contest 173 题解 目录 AtCoder Beginner Contest 173 题解 A - Payment B - Judge Status Summ ...

  5. AtCoder Beginner Contest 100 2018/06/16

    A - Happy Birthday! Time limit : 2sec / Memory limit : 1000MB Score: 100 points Problem Statement E8 ...

  6. AtCoder Beginner Contest 052

    没看到Beginner,然后就做啊做,发现A,B太简单了...然后想想做完算了..没想到C卡了一下,然后还是做出来了.D的话瞎想了一下,然后感觉也没问题.假装all kill.2333 AtCoder ...

  7. AtCoder Beginner Contest 053 ABCD题

    A - ABC/ARC Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Smeke has ...

  8. AtCoder Beginner Contest 136

    AtCoder Beginner Contest 136 题目链接 A - +-x 直接取\(max\)即可. Code #include <bits/stdc++.h> using na ...

  9. AtCoder Beginner Contest 137 F

    AtCoder Beginner Contest 137 F 数论鬼题(虽然不算特别数论) 希望你在浏览这篇题解前已经知道了费马小定理 利用用费马小定理构造函数\(g(x)=(x-i)^{P-1}\) ...

随机推荐

  1. php程序猿面试分享

    面试总结 今天去了北京著名IT公司进行PHP程序猿的面试.这是人生第一次么,怎么不紧张?我是不是有病.不是.这叫自信呵. 首先是做一些笔试题. 1.mysql数据库索引使用的数据结构?这样做的优点是? ...

  2. RadioButton使用

    RadioButton和CheckBox差不多,这里只写一个,因为我本身不是学andorid,所以就当给自己留一个备份,省的每次用到都需要代码敲一次,很麻烦 1.如果想选中时想改变颜色可以设置一个xm ...

  3. what's the python之基本运算符及字符串、列表、元祖、集合、字典的内置方法

    计算机可以进行的运算有很多种,运算按种类可分为算数运算.比较运算.逻辑运算.赋值运算.成员运算.身份运算.字符串和列表的算数运算只能用+和*,字典没有顺序,所以不能进行算数运算和比较运算.比较运算中= ...

  4. MySQL的nnodb引擎表数据分区存储

    Symlinks are fully supported only for MyISAM tables. 对应Innodb引擎数据文件放到其他目录 mysql> SHOW VARIABLES L ...

  5. 003-docker命令-远程镜像仓库命令,本地镜像管理命令

    1.远程镜像仓库 docker login/logout:查看 [不常用] docker push:查看 [不常用] docker search:从Docker Hub查找镜像 语法:docker s ...

  6. 20165236 2017-2018-2《Java程序设计》课程总结

    20165236 2017-2018-2<Java程序设计>课程总结 一.每周作业链接汇总: 1.我期望的师生关系 2.学习基础和C语言基础调查 3.20165236郭金涛 预备作业3 L ...

  7. Python 全栈开发九 日志模块

    日志是一种可以追踪某些软件运行时所发生事件的方法.软件开发人员可以向他们的代码中调用日志记录相关的方法来表明发生了某些事情.一个事件可以用一个可包含可选变量数据的消息来描述.此外,事件也有重要性的概念 ...

  8. openshift node资源限制

    在oc的node配置文件中添加 ...... kubeletArguments: cgroups-per-qos: - "true" cgroup-driver: - " ...

  9. Python的原型开发带来的关于Mock的思考

    Python非常受欢迎,主要原因之一它包包多,能让你快速实现一个功能,并且很方便运行并看到效果,因此,它非常适合做原型开发. 什么是原型开发? 原型开发就是实现一个简单版本的开发. 在使用其他高级语言 ...

  10. heapy() :python自带的堆排序

    堆是一个二叉树,其中每个父节点的值都小于或等于其所有子节点的值.整个堆的最小元素总是位于二叉树的根节点.python的heapq模块提供了对堆的支持. 堆数据结构最重要的特征是heap[0]永远是最小 ...