hdu-1039-Easier Done Than Said?

保姆级教程:手把手带你复现APFNet论文的RGBT目标跟踪模型(附完整代码与数据集配置) 本文提供了一份详细的APFNet论文复现指南,涵盖从环境搭建到模型测试的全流程。通过解析多模态融合模块和渐进式训练流程,帮助读者高效完成RGBT目标跟踪模型的复现工作,特别针对训练和测试中的常见问题提供实用解决方案。 阅读详情

Easier Done Than Said?

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 14313 Accepted Submission(s): 6934

Problem Description

Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard time remembering them and sometimes leave them written on notes stuck to their computer. One potential solution is to generate "pronounceable" passwords that are relatively secure but still easy to remember.

FnordCom is developing such a password generator. You work in the quality control department, and it's your job to test the generator and make sure that the passwords are acceptable. To be acceptable, a password must satisfy these three rules:

It must contain at least one vowel.

It cannot contain three consecutive vowels or three consecutive consonants.

It cannot contain two consecutive occurrences of the same letter, except for 'ee' or 'oo'.

(For the purposes of this problem, the vowels are 'a', 'e', 'i', 'o', and 'u'; all other letters are consonants.) Note that these rules are not perfect; there are many common/pronounceable words that are not acceptable.

Input

The input consists of one or more potential passwords, one per line, followed by a line containing only the word 'end' that signals the end of the file. Each password is at least one and at most twenty letters long and consists only of lowercase letters.

Output

For each password, output whether or not it is acceptable, using the precise format shown in the example.

Sample Input

a
tv
ptoui
bontres
zoggax
wiinq
eep
houctuh
end

Sample Output

<a> is acceptable.
<tv> is not acceptable.
<ptoui> is not acceptable.
<bontres> is not acceptable.
<zoggax> is not acceptable.
<wiinq> is not acceptable.
<eep> is acceptable.
<houctuh> is acceptable.

题意: 1.至少有一个元音 2.不能有三个连续的元音,和三个连续的辅音 3.除了 oo和ee不能有其他连续的字母,,
满足上面三条输出 is acceptable.否者输出 is not acceptable.

code

#include<string>
#include<iostream>
using namespace std;
bool isok(char a)///判断是否是元音
{
    if(a=='a'||a=='e'||a=='i'||a=='o'||a=='u')
        return true;
    return false;
}
int main()
{
    string s;
    while(cin>>s){
        if(s=="end") break;
        int a=0,b=0;
        bool ans=true,falg=false;
        for(int i=0;i<s.size();i++){
           // cout<<s[i]<<endl;
            if(isok(s[i])){ falg=true;
               // cout<<"有元英"<<endl;
            }
            if(isok(s[i])){
                a++;
                b=0;
            }else{
               b++;
               a=0;
            }
           // cout<<a<<" "<<b<<endl;
            if(a>=3||b>=3){
                ans=false;
                break;
            }
            if(s[i]!='o'&&s[i]!='e'&&i>0){
                if(s[i-1]==s[i]){ans=false;break;}
            }
        }
        if(ans&&falg) cout<<'<'<<s<<'>'<<" is acceptable."<<endl;
        else cout<<'<'<<s<<'>'<<" is not acceptable."<<endl;
    }
    return 0;
}



域控制器开发避坑实录:从硬件设计到软件集成的5个关键挑战 本文深入剖析了域控制器开发中的5大关键挑战,从硬件选型到软件集成,涵盖智能驾驶芯片选择、实时性优化、AUTOSAR架构适配等核心问题。通过实战案例和数据对比,为工程师提供避坑指南,助力提升开发效率和系统可靠性。 阅读详情

相关推荐

银河麒麟V10 SP1忘记密码?3分钟搞定单用户模式密码重置(附详细截图)

本文详细介绍了银河麒麟V10 SP1操作系统忘记登录密码后的应急恢复方法。核心是通过GRUB引导菜单进入单用户模式,无需密码即可获得root权限,从而快速重置用户密码。文章提供了从捕捉GRUB界面、编辑启动参数到执行密码修改命令的完整步骤图解与常见问题解决方案,帮助用户在几分钟内恢复系统访问。

w3x4y的博客 947

HDU--1039:Easier Done Than Said? (字符串)

2. 解题代码:

酒酿小圆子呀~ 763

DSSAT模型建模教程

随着数字农业和智慧农业的发展,基于过程的作物生长模型(Process-based Crop Growth Simulation Model)在模拟作物对气候变化的响应与适应、农田管理优化、作物品种和株型筛选、农业碳中和、农田固碳减排等领域扮演着越来越重要的作用。现有版本V4.7能模拟27种主要农作物的生长发育和产量形成过程,被广泛应用于精细农业、水肥管理、气候变化、粮食安全、土壤碳周转、环境影响、农业可持续性、农业生态等诸多与农业生产和科研有关的领域。如果你是个模型入门者,这次将让你体验一键模拟的乐趣。

weixin_55561616的博客 1418

杭电1039 之 Easier Done Than Said?

Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-ge

ESESZB的博客 516

双斜率积分ADC:高精度测量中的经典选择与TC530/TC534实战指南

模数转换器(ADC)是连接模拟世界与数字系统的关键桥梁,其核心任务是将连续的模拟信号转换为离散的数字量。在众多ADC类型中,双斜率积分ADC以其独特的原理脱颖而出,它通过积分与反积分的线性过程,用时间换取精度,实现了对噪声的卓越抑制和极高的线性度。这种技术价值使其在对抗工频干扰、追求长期稳定性的场景中无可替代,尤其适用于精密测量仪表和工业传感器信号采集。本文聚焦于双斜率积分ADC的经典代表TC530与TC534,深入剖析其工作原理、关键参数如积分电阻、积分电容的选择,并提供从硬件电路设计到软件驱动的完整实战

weixin_30847063的博客 365

告别环境依赖!用PyInstaller把PaddleOCR项目打包成独立EXE(附完整spec文件配置)

本文详细介绍了如何使用PyInstaller将PaddleOCR项目打包成独立EXE文件,彻底解决Python环境依赖问题。通过完整的spec文件配置和实战技巧,开发者可以轻松创建开箱即用的OCR工具,特别适合需要交付给非技术用户的场景。文章涵盖环境配置、模型打包、性能优化等关键环节,并提供了解决常见问题的方案。

weixin_33712987的博客 582

字符串处理--HDU第1039解题报告

题目链接 要满足三个条件,所以最好一点写成一个函数,这样做就不会像全部代码都在main()函数中写一样,要考虑很多细节。 这三个函数都很简单。(我再也不用划译了,条件二给翻译错了,哎,加强英语吧) 下面是代码: #include #include using namespace std; bool rule_one(string &str); bool rule_two(s

剑行earth 529

CubeMX配置ADC+DMA避坑实战:如何避免采样过快导致的系统崩溃

本文针对STM32开发中常见的ADC采样过快导致程序卡死问题,提供了基于CubeMX的实战避坑指南。通过分析ADC与DMA协作机制,详解时钟配置、采样时间、DMA缓冲区长度及中断设置等关键步骤,帮助开发者从源头规避系统崩溃风险,实现稳定可靠的数据采集。

weixin_28273593的博客 329

HDU1039(字符串水题)

题目简述: 判断字符串是否同时满足: 1:有元音字母 2:不能三个连续元音或辅音 3.不能连续两个相同的字母,除非ee或oo end终止输入 AC代码: #include&lt;iostream&gt; #include&lt;string&gt; using namespace std; int yuan(char c) {     if (c == 'a' || c == 'e'...

weirdo_coder的博客 448

YOLOv11的对比学习预训练改进-(通过SimCLR预训练增强特征提取)

本文介绍了将SimCLR对比学习预训练与YOLOv11目标检测模型相结合的创新方法。文章首先概述了目标检测领域的发展现状和YOLOv11的架构优化,包括主干网络、特征金字塔和检测头的改进设计。其次详细解析了SimCLR对比学习的核心原理,涵盖数据增强、投影头设计和NT-Xent损失函数。最后探讨了如何将对比学习与目标检测有效结合,通过特征空间对齐和渐进式微调策略提升模型性能。该方法显著增强了特征提取能力,提高了检测精度和训练效率,特别是在小目标和遮挡目标的检测上表现突出。

本博客聚焦 YOLOv11 全流程落地,涵盖架构优化、数据集处理、训练技巧与多场景部署,兼及国产数据库、Java 开发与 AI 模型应用,内容兼顾理论与工程实践,为开发者提供系统干货,助力高效提升技术能力。 688

STM32G0/G4电机控制中三角函数与浮点运算优化实战

三角函数(sin/cos)和浮点运算是电机矢量控制(FOC)的核心基础,直接影响Clark/Park变换、SVPWM及观测器的实时性与精度。在资源受限的MCU上,标准math.h库因无硬件FPU支持而引发严重时序抖动,导致电流环延迟、转矩脉动增大甚至系统复位。通过硬件加速(如STM32G4的CORDIC协处理器)或定制化定点算法(如STM32G0的查表+线性插值),可将sin/cos计算从数十微秒压缩至1–3 μs量级,提升30倍以上效率。该方案广泛适用于BLDC/PMSM驱动、伺服控制及高动态响应嵌入式运

weixin_35751412的博客 112

HDU(1039):Easier Done Than Said?

题目: Problem Description  One potential solution is to generate "pronounceable" passwords that are relatively secure but still easy to remember.FnordCom is developing such a password generator. You w...

Zayn123的博客 362

3D打印机控制系统设计:基于MATLAB的3D打印机运动学建模、轨迹规划和控制

控制实现:在控制实现中,需要将轨迹规划的结果转化为实际的控制指令,控制3D打印机按照规划的轨迹进行运动。3D打印机的运动学建模:3D打印机的运动学建模是指将3D打印机的机械结构、传动系统和运动控制部件等抽象成数学模型,以便于进行控制系统的设计和分析。轨迹规划:轨迹规划是指根据3D模型的几何形状和打印机的运动学模型,计算出打印机需要执行的运动轨迹,以便于实现所需的打印效果。控制实现:控制实现是指将轨迹规划的结果转化为控制指令,控制3D打印机按照规划的轨迹进行运动。

走向CTO的路上... 2477

HDU(简单题目) 1038 Biker's Trip Odometer 1039 Easier Done Than Said?

心情不好,找了几个水题 1038 Biker's Trip Odometer  题意难懂,直径  圈数  时间,算总的路程,然而车走的是步数,要化成mile /* HDU 1038 题意:直径 圈数 时间 思路:算出总路程,然而这个路程是步数,要换算成mile */ #include #include using namespace std; const double p

huatian5的博客 538

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

HDU1038——Biker‘s Trip Odometer,HDU1039——Easier Done Than Said?,HDU1040——As Easy As A+B

目录HDU1038——Biker's Trip Odometer题目描述运行代码代码思路HDU1039——Easier Done Than Said?题目描述运行代码代码思路HDU1040——As Easy As A+B题目描述运行代码(冒泡排序)代码思路运行代码(快速排序)代码思路Problem - 1038 代码思路 初始化:无限循环:计算行驶距离:计算平均速度:输出结果:输出格式化的字符串,显示旅行编号、行驶距离和平均速度。使用 和 控制输出的格式,确保小数点后两位的精度。更新计数器:每

u014114223的博客 1712

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

hdu1039Easier Done Than Said?

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8339 Accepted Submission(s): 4093Problem Description Password secur

wo的只属于我 285

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

HDU1039 Easier Done Than Said

HDU1039 Easier Done Than Said

htrdchh的博客 353

HDU 1039 Easier Done Than Said?

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12751    Accepted Submission(s): 6165 Problem Description Pa

乐云天的博客 313

hdu 1039 Easier Done Than Said?

比较恶心的字符串题!! #include using namespace std; int main() {     string str;    while(cin>>str,str!="end")    {        int flag=0,f=0;        for(int i=0;i        {            if(str[i]=='a'||str

成长ing 308

HDU ACM1039——Easier Done Than Said?

Easier Done Than Said? Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites ...

BarisGuo的博客 490

HDU 1039 Easier Done Than Said?

Problem DescriptionPassword security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-gener

贾作真时真亦贾的博客 413

HDU 1039 Easier Done Than Said? water~~~

题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1039 无聊的时候刷刷水题。 AC代码: #include #include #include #include #include #include #include #include #include #include #include #includ

lamborghini1993 969

HDU-1039 Easier Done Than Said?

HDU-1039 Easier Done Than Said? 问题描述: Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but

m0_51727949的博客 181

HDU——1039 Easier Done Than Said?

Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-ge...

LightOn 256

HDU1039 Easier Done Than Said?

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7822    Accepted Submission(s): 3863 Problem Description Pas

长风的专栏 866

Easier Done Than Said? hdu 1039

Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6135    Accepted Submission(s): 3048 Problem Description Passwor

风华绝代 742
上一篇: hdu-1035-Robot Motion
下一篇: hdu-1702-ACboy needs your help again!
小k安达
博客等级 码龄10年 147粉丝 202原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值