?(>_o)!


Time Limit: 2 Seconds      Memory Limit: 65536 KB


?(>_o)! is a pseudo-object-oriented programming language. It implements the following commands:

Command Description
? Check whether the character '?' is in the program's source code. If '?' does not exist in the program's source, the hardware will catch fire or explode.
( It tries to match ')', although mismatch of brackets does not matter at all.
> Increase the internal accumulator.
_ Print the program's source code.
o Instantiate an object of a new sub class of the generic super class. Due to the best principles of object hiding, this object cannot be accessed in any way.
) Just matches '('. It's for patient with obsessive-compulsive disorder. However, mismatch of brackets does not matter at all.
! Print "Hello, world!".
Other characters Be treated as comments rather than instruction.

However, it's only another joke programming language. There is even no way to access the accumulator. But it's one of easiest to finish a "Hello world" program or a quine program. A quine
is a computer program which takes no input and produces a copy of its own source code as its only output. Your task is to judge whether a ?(>_o)! program is a quine.

Input

There are multiple test cases. The first line of input is an integer T indicates the number of test cases. For each test case:

There is one line of string represents the source code of a ?(>_o)! program. The program contains no more than 256 characters. The ASCII value of each character is within [32, 126].

Output

For each test case, output "Yes" if it is a quine. Otherwise, output "No".

Sample Input

4
Hello, world!
source_code
source__code
?(>_o)!

Sample Output

Yes
Yes
No
No

Hint

The output of the four sample programs are {"Hello, world!", "source_code", "source__codesource__code", "?(>_o)!Hello, world!"} respectively. Therefore the first two programs are quines,
and the last two are not.

Luckily, there is a '?' in the fourth program, so the hardware will not catch fire or explode during running the fourth program.

—————————————————————————————————————

题目的意思又臭又长,其实没什么就是给出一个字符串,!表示输出Hello, world!,_表示把原字符串输出一遍,判断输出的字符串和原字符串是否一样

#include <iostream>
#include<queue>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include <cstring>
using namespace std;
#define LL long long int main()
{ int T;
char s[100004];
char ss[100004];
char sh[]="Hello, world!";
scanf("%d",&T);
getchar();
while(T--)
{
int cnt=0;
gets(s);
memset(ss,0,sizeof(ss));
int k=strlen(s);
for(int i=0;i<k;i++)
{
if(s[i]=='_') strcat(ss,s);
if(s[i]=='!') strcat(ss,sh);
}
if(strcmp(ss,s)!=0) printf("No\n");
else printf("Yes\n");
}
return 0;
}

ZOJ3775 ?(>_o)! 2017-04-13 23:37 110人阅读 评论(0) 收藏的更多相关文章

  1. 并查集 基础 AC 2014-01-14 13:37 202人阅读 评论(0) 收藏

    题目地址:http://haut.openjudge.cn/20131112/6/ 求编号最多的组 查看 提交 统计 提问 总时间限制:  1000ms  内存限制:  63353kB 描述 相邻两个 ...

  2. NYOJ-235 zb的生日 AC 分类: NYOJ 2013-12-30 23:10 183人阅读 评论(0) 收藏

    DFS算法: #include<stdio.h> #include<math.h> void find(int k,int w); int num[23]={0}; int m ...

  3. HDU 2040 亲和数 [补] 分类: ACM 2015-06-25 23:10 10人阅读 评论(0) 收藏

    今天和昨天都没有做题,昨天是因为复习太累后面忘了,今天也是上午考毛概,下午又忙着复习计算机图形学,晚上也是忘了结果打了暗黑3,把暗黑3 打通关了,以后都不会玩太多游戏了,争取明天做3题把题目补上,拖越 ...

  4. iOS中UITextField 使用全面解析 分类: ios技术 2015-04-10 14:37 153人阅读 评论(0) 收藏

    //初始化textfield并设置位置及大小   UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 13 ...

  5. 记一个神奇的WAS问题:sibuswsgw-sibuswsgw_console.jar invalid LOC header (bad signature) 分类: WebSphere 2015-08-06 23:21 9人阅读 评论(0) 收藏

    今天晚上,出现了一个神奇的WAS问题,详细问题异常信息如下: [15-8-6 22:13:29:146 CST] 00000013 ApplicationMg A WSVR0203I: 应用程序:is ...

  6. Hdu 1009 FatMouse' Trade 2016-05-05 23:02 86人阅读 评论(0) 收藏

    FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tot ...

  7. ZOJ2482 IP Address 2017-04-18 23:11 44人阅读 评论(0) 收藏

    IP Address Time Limit: 2 Seconds      Memory Limit: 65536 KB Suppose you are reading byte streams fr ...

  8. PAT甲 1029. Median (25) 2016-09-09 23:11 27人阅读 评论(0) 收藏

    1029. Median (25) 时间限制 1000 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given an incr ...

  9. PAT甲 1011. World Cup Betting (20) 2016-09-09 23:06 18人阅读 评论(0) 收藏

    1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...

随机推荐

  1. 卸载 visual studio 2012时先把系统还原打开

    否则,会停留在创建还原点那儿很长时间 .

  2. 02 - Unit011:Spring AOP

    Spring AOP 面向切面(儿)编程(横切编程) Spring 核心功能之一 Spring 利用AspectJ 实现. 底层是利用 反射的动态代理机制实现的 其好处: 在不改变原有功能情况下, 为 ...

  3. A Newbie’s Install of Keras & Tensorflow on Windows 10 with R

    This weekend, I decided it was time: I was going to update my Python environment and get Keras and T ...

  4. android单元测试 activity跳转 以及 input 输入后 测试

    Android junit实现多个Activity跳转测试 分类: Android Junit测试2011-11-14 16:49 1601人阅读 评论(2) 收藏 举报 androidjunitla ...

  5. linux编程基本

    库的使用头文件:.h 里面的函数及变量的声明 比如#include <stdio.h> ,Linux下默认头文件的搜索路径 系统定义的头文件: /usr/include /usr/loca ...

  6. python3调用阿里云语音服务

    步骤 1 创建阿里云账号,包括语音服务里的企业实名 为了访问语音服务,您需要有一个阿里云账号.如果没有,可首先按照如下步骤创建阿里云账号: 访问阿里云 官方网站,单击页面上的 免费注册 按钮. 按照屏 ...

  7. 在SUSE Linux Enterprise 11 SP1上用UDEV SCSI配置ASM

    1. 编辑/etc/scsi_id.config文件,如果该文件不存在,则创建该文件,添加如下行: options=–whitelisted –replace-whitespace 2. 获取需要绑定 ...

  8. AngularJS学习笔记(1)——MVC模式的清单列表效果

    MVC模式的清单列表效果 使用WebStorm新建todo.html并链入bootstrap.css.bootstrap-theme.css.angular.js.要链入的相关css和js文件预先准备 ...

  9. UNITY 接讯飞语音过程总结

    11:13 2017/3/141,安装问题:JDK与ECLIPSE位数一定要对应,32位对64位会出现 java was returned ....code 13的弹框错误.版本号可以不一致.2,EC ...

  10. 迷你MVVM框架 avalonjs 0.94发布

    本版本主要做了如下改进: 优化ms-if的逻辑,现在描述DOM的顺序是 ms-skip, ms-important, ms-controller, ms-if ... 只要元素存在ms-skip 这个 ...