hdoj 5198 Strange Class 水题
Strange Class
Time Limit: 1 Sec Memory Limit: 256 MB
题目连接
http://acm.hdu.edu.cn/showproblem.php?pid=5198
Description
Vivid makes friends with so many students, he wants to know who are in SC.
Input
Please process to the end of file.
[Technical Specification]
1≤|S|≤10.
|S| indicates the length of S.
S only contains lowercase letter.
Output
Sample Input
abc bc
Sample Output
HINT
题意
问你名字是否为a^nb^nc^n这种类型的
题解:
乱搞嘛,先除以3,然后乱搞
~\(≧▽≦)/~啦啦啦
代码:
//qscqesze
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 200001
#define mod 10007
#define eps 1e-9
//const int inf=0x7fffffff; //无限大
const int inf=0x3f3f3f3f;
/*
inline ll read()
{
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
int buf[10];
inline void write(int i) {
int p = 0;if(i == 0) p++;
else while(i) {buf[p++] = i % 10;i /= 10;}
for(int j = p-1; j >=0; j--) putchar('0' + buf[j]);
printf("\n");
}
*/
//************************************************************************************** int main()
{
string s;
while(cin>>s)
{
int flag=;
if(s.size()%!=)
flag=;
char ch1=s[];
for(int i=;i<s.size()/;i++)
if(s[i]!=ch1)
flag=;
char ch2=s[s.size()/];
for(int i=s.size()/;i<s.size()/*;i++)
if(s[i]!=ch2)
flag=;
char ch3=s[s.size()/*];
for(int i=s.size()/*;i<s.size();i++)
if(s[i]!=ch3)
flag=;
if(ch1==ch2||ch2==ch3||ch1==ch3)
flag=;
if(flag)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
}
hdoj 5198 Strange Class 水题的更多相关文章
- Codeforces Round #373 (Div. 2) C. Efim and Strange Grade 水题
C. Efim and Strange Grade 题目连接: http://codeforces.com/contest/719/problem/C Description Efim just re ...
- HDOJ 1056 HangOver(水题)
Problem Description How far can you make a stack of cards overhang a table? If you have one card, yo ...
- HDOJ(HDU) 1718 Rank(水题、、、)
Problem Description Jackson wants to know his rank in the class. The professor has posted a list of ...
- hdoj 4450 Draw Something 水题
Draw Something Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tota ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- 水题 HDOJ 4727 The Number Off of FFF
题目传送门 /* 水题:判断前后的差值是否为1,b[i]记录差值,若没有找到,则是第一个出错 */ #include <cstdio> #include <iostream> ...
- 水题 HDOJ 4716 A Computer Graphics Problem
题目传送门 /* 水题:看见x是十的倍数就简单了 */ #include <cstdio> #include <iostream> #include <algorithm ...
- HDOJ/HDU 1328 IBM Minus One(水题一个,试试手)
Problem Description You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or ...
- HDOJ/HDU 1256 画8(绞下思维~水题)
Problem Description 谁画8画的好,画的快,今后就发的快,学业发达,事业发达,祝大家发,发,发. Input 输入的第一行为一个整数N,表示后面有N组数据. 每组数据中有一个字符和一 ...
随机推荐
- u-boot移植随笔(7):u-boot启动流程简图【转】
转自:http://www.latelee.org/porting-uboot/u-boot-porting-bootstrap.html u-boot移植随笔:u-boot启动流程简图 画上面这张图 ...
- mysql高可用架构 -> MHA配置binlog-server-06
前期准备 1.准备一台新的mysql实例(db03),GTID必须开启. 2.将来binlog接收目录,不能和主库binlog目录一样 停止mha masterha_stop --conf=/etc/ ...
- java基础23 Math类和Random类
一.Math数学类 主要是提供很多数学的公式 1.1.Math类的常用方法 abs(int a):绝对值 ceil(double a):向上取整 floor(double a):向下取整 ...
- gcc/g++ 命令
gcc & g++现在是gnu中最主要和最流行的c & c++编译器 .g++是c++的命令,以.cpp为主,对于c语言后缀名一般为.c.这时候命令换做gcc即可.其实是无关紧要的.其 ...
- NopCommerce 执行计划任务不同Services协调操作导致更新数据失败的问题!
问题描述: 在Nop的计划任务里需要两个任务协调操作 _shipmentService.InsertShipment(shipment); _orderProcessingService.Ship(s ...
- CI框架整合UEditor编辑器上传功能
最近项目中要使用到富文本编辑器,选用了功能强大的UEditor,接下来就来讲讲UEditor编辑器的上传功能整合. 本文UEditor版本:ueditor1_4_3_utf8_php版本 第一步:部署 ...
- CF 586B 起点到终点的最短路和次短路之和
起点是右下角 终点是左上角 每次数据都是两行的点 输入n 表示有n列 接下来来的2行是 列与列之间的距离 最后一行是 行之间的距离 枚举就行 Sample test(s) input 41 ...
- CSharp中的?.运算符
在编译chromiumFX工程时候,编译失败,无法正常工作.是运算符 (?.)的错误,经过查找,该运算符 参考NULL 条件运算符(C# 和 Visual Basic) 用于在执行成员访问 (?.) ...
- HTTP.Socket.TCP详解
这会没事,整理了一下HTTP,socket,TCP之间的关系与区别,我们在面试的时候应该会经常问到这方面的东西,那么什么是HTTP呢? HTTP属于老话题了,在项目中我们经常需要往服务端发POST或者 ...
- Ubuntu16.04下HBase的安装与配置
一.环境 os : Ubuntu 16.04 LTS 64bit jdk : 1.8.0_161 hadoop : mysql : hive : hbase: -hadoop2 安装HBase前,系统 ...