重点在判重的方法,嘻嘻

题目

#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
int main()
{
int i,j,len,mark[],num,flag;
char ch[];
while(gets(ch))
{
if(strcmp("*",ch)==)break;
len=strlen(ch);
flag=;
for(i=;i<len;i++)
{
memset(mark,,sizeof(mark));
for(j=;j<len-i;j++)
{
num=(ch[j]-'A'+)*+ch[j+i]-'A'+;
if(mark[num]==)
{
flag=;
break;
}
mark[num]=;
}
if(flag==)break;
}
if(flag==)
printf("%s is NOT surprising.\n",ch);
else
printf("%s is surprising.\n",ch);
}
return ;
}

hdu 2736 Surprising Strings(类似哈希,字符串处理)的更多相关文章

  1. HDU 2736 Surprising Strings

                                    Surprising Strings Time Limit:1000MS     Memory Limit:65536KB     64 ...

  2. HDOJ 2736 Surprising Strings

    Surprising Strings Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  3. 【字符串题目】poj 3096 Surprising Strings

    Surprising Strings Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6193   Accepted: 403 ...

  4. [POJ3096]Surprising Strings

    [POJ3096]Surprising Strings 试题描述 The D-pairs of a string of letters are the ordered pairs of letters ...

  5. C - Surprising Strings

                                   C - Surprising Strings 题意:输入一段字符串,假设在同一距离下有两个字符串同样输出Not surprising ,否 ...

  6. POJ 3096 Surprising Strings

    Surprising Strings Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5081   Accepted: 333 ...

  7. [ACM] POJ 3096 Surprising Strings (map使用)

    Surprising Strings Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5783   Accepted: 379 ...

  8. POJ 3096:Surprising Strings

    Surprising Strings Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6258   Accepted: 407 ...

  9. HDU 6170 Two strings( DP+字符串匹配)

    http://acm.hdu.edu.cn/showproblem.php?pid=6170 题目大意: 给出两个字符串s1和s2(长度小于等于2500). s1是一个正常的包含大小写字母的字符串,s ...

随机推荐

  1. Codevs 3231 小吃

     时间限制: 1 s  空间限制: 16000 KB  题目等级 : 黄金 Gold 题目描述 Description 这里简直是吃货的天堂,小吃太多了.数不胜数. 假设岛上有N种小吃,每种体积Vi, ...

  2. Centos(Linux) 根文件系统

    /下面的文件 /boot:系统启动相关的文件:如内核,inittrd ,以及MBR grub /dev :设备文件: 块设备:随机访问,数据块 如:USB 字符设备:线性访问,按字符为单位如:鼠标,按 ...

  3. linux terminal 日常shell

    1 ubuntu中如何将终端添加到右键 /home/cui/.local/share/nautilus/scripts #!/bin/bash #cd $NAUTILUS_SCRIPT_CURRENT ...

  4. 使用tortoisegit管理git 和 权限验证

    1 安装Git 2 安装Tortoise 3 在git.oschina 或者 github上创建项目 4 Tortoise配置 TortoiseGit 使用扩展名为ppk的密钥,而不是ssh-keyg ...

  5. Coolpy使用教程

    ---恢复内容开始--- Coolpy使用教程 1.硬件:arduino+ Ethernet Shield w5100 2.下载硬件rom,然后将rom烧进arduino. (下载地址)http:// ...

  6. centos中安装chromium和flash

    安装环境:centos 6.5 64位 在centos中安装chromium 安装Google源 cd /etc/yum.repos.d/ sudo wget http://people.CentOS ...

  7. linux服务器修改ftp默认21端口方法

    1.登录服务器,打开vsftp.conf文件 # vim /etc/vsftpd/vsftpd.conf 2.在文件末尾增加listen_port=8021 #remote_charset=CP125 ...

  8. DataSnap数据库连接池,数据集对象池的应用

    传统的应用服务器的开发往往是在ServerMethods单元中拖放一堆TDataSet, TDaTaSetProvider控件,这是一个最简单粗暴的开发方向,往往会造成服务端程序文件的臃肿.服务运行期 ...

  9. AS3 - 数组Array的几个常用方法(附样例)

    AS3 - 数组Array的几个常用方法(附样例) 2015-03-30 10:39发布:hangge浏览:241   Flex/Flash开发中,经常会使用到数组,下面总结了一些数组的常用方法. 1 ...

  10. 9、XAML名称空间详解

    XAML命名空间 <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"      ...