概述
题目描述如下:
A. Boy or Girl
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Those days, many boys use beautiful girls' photos as avatars in forums. So it is pretty hard to tell the gender of a user at the first glance. Last year, our hero went to a forum and had a nice chat with a beauty (he thought so). After that they talked very often and eventually they became a couple in the network.
But yesterday, he came to see "her" in the real world and found out "she" is actually a very strong man! Our hero is very sad and he is too tired to love again now. So he came up with a way to recognize users' genders by their user names.
This is his method: if the number of distinct characters in one's user name is odd, then he is a male, otherwise she is a female. You are given the string that denotes the user name, please help our hero to determine the gender of this user by his method.
Input
The first line contains a non-empty string, that contains only lowercase English letters — the user name. This string contains at most 100 letters.
Output
If it is a female by our hero's method, print "CHAT WITH HER!" (without the quotes), otherwise, print "IGNORE HIM!" (without the quotes).
Examples
input
Copy
wjmzbmr
output
Copy
CHAT WITH HER!
input
Copy
xiaodao
output
Copy
IGNORE HIM!
input
Copy
sevenkplus
output
Copy
CHAT WITH HER!
Note
For the first example. There are 6 distinct characters in "wjmzbmr". These characters are: "w", "j", "m", "z", "b", "r". So wjmzbmr is a female and you should print "CHAT WITH HER!".
ac代码(内容很水,开头2~60行秀了点头文件,可以去掉!):
#include<bits/stdc++.h>
#include<windows.h>
#include<assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include<limits.h>
#include<locale.h>
#include <math.h>
#include <stdio.h>
#include<stdlib.h>
#include <string.h>
#include<time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include<iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
/*
嘻嘻,
2~60行可以全部去掉!
*/
using namespace std;
#define intc(n); int n;cin>>n;
#define strc(s); string s;cin>>s;
#define qfor(i,n) for(i=0;i<n;i++)
#define qw(tc) while(tc--)
#define pb push_back
#define popb push_back
const int n=101;
bool f[n];
int main()
{
cin.tie(0);
ios::sync_with_stdio(0);//防超时
string s;
cin>>s;
for(int i=0;i<int(s.size());i++)
{
char c=s[i];
f[int(c)]=1;
}
int g=0;
for(int i=0;i<=127;i++)
{
if(f[i])
g++;
}
cout<<(g%2==0?"CHAT WITH HER":"IGNORE HIM");
return 0;
}
来源:
Problem - 236A - CodeforcesCodeforces. Programming competitions and contests, programming communityhttps://codeforces.com/problemset/problem/236/A
我们下回再见,欢迎大家关注我!
最后
以上就是时尚自行车为你收集整理的第13期《codeforces 236A - Boy or Girl 题解 》的全部内容,希望文章能够帮你解决第13期《codeforces 236A - Boy or Girl 题解 》所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复