hdu 1048

基于深度学习的生姜种芽识别与朝向判定方案 机器视觉在农业自动化中的应用,正在从简单的目标检测扩展到更精细的几何属性分析。目标检测模型擅长定位小目标,角度回归则解决方向估计问题,二者结合可实现生姜种芽的精准定位与朝向判定。通过两阶段建模——先用YOLOv8检测种芽位置,再裁剪子图用sin/cos角度回归头预测芽尖方向,既保证小目标召回率,又规避旋转框标注的复杂性与不一致性。该技术路线适用于播种机视觉系统、种芽分选设备等场景,能有效降低人工重复判断的负担,提升农业作业效率。文中数据定义、训练参数与多个工程避坑经验,可为工业视觉中涉及角度回归的任务提供直 阅读详情

The Hardest Problem Ever

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


Problem Description
Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of the first ciphers. This cipher was so incredibly sound, that no one could figure it out without knowing how it worked.
You are a sub captain of Caesar's army. It is your job to decipher the messages sent by Caesar and provide to your general. The code is simple. For each letter in a plaintext message, you shift it five places to the right to create the secure message (i.e., if the letter is 'A', the cipher text would be 'F'). Since you are creating plain text out of Caesar's messages, you will do the opposite:

Cipher text
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Plain text
V W X Y Z A B C D E F G H I J K L M N O P Q R S T U

Only letters are shifted in this cipher. Any non-alphabetical character should remain the same, and all alphabetical characters will be upper case.
 

Input
Input to this problem will consist of a (non-empty) series of up to 100 data sets. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets. All characters will be uppercase.

A single data set has 3 components:

Start line - A single line, "START"

Cipher message - A single line containing from one to two hundred characters, inclusive, comprising a single message from Caesar

End line - A single line, "END"

Following the final data set will be a single line, "ENDOFINPUT".
 

Output
For each data set, there will be exactly one line of output. This is the original message by Caesar.
 

Sample Input
  
START NS BFW, JAJSYX TK NRUTWYFSHJ FWJ YMJ WJXZQY TK YWNANFQ HFZXJX END START N BTZQI WFYMJW GJ KNWXY NS F QNYYQJ NGJWNFS ANQQFLJ YMFS XJHTSI NS WTRJ END START IFSLJW PSTBX KZQQ BJQQ YMFY HFJXFW NX RTWJ IFSLJWTZX YMFS MJ END ENDOFINPUT
 

Sample Output
  
IN WAR, EVENTS OF IMPORTANCE ARE THE RESULT OF TRIVIAL CAUSES I WOULD RATHER BE FIRST IN A LITTLE IBERIAN VILLAGE THAN SECOND IN ROME DANGER KNOWS FULL WELL THAT CAESAR IS MORE DANGEROUS THAN HE
 

Source
 
#include <iostream>
#include <string>
using namespace std;
int main()
{
	char ch;
	string s;
	while(cin>>s)
	{   
		getchar();
		if(s=="ENDOFINPUT")
			break;
		else		
			while((ch= getchar())!='\n')
			{
				if(isalpha(ch))
					cout<<char(ch>=70? ch-5:ch+21);//A is 65, Z is 90
				else
					cout<<ch;
			}
		cout<<endl;		
		cin>>s;
	}
	
	return 0; 
}

课程资源 杭电OJ1000-1099答案 课程资源 杭电OJ1000-1099答案 ,仅供参考... 立即下载

相关推荐

数据工程师——ETL

文章摘要 ETL(数据抽取、转换、加载)是数据处理的核心流程,负责将分散数据源整合为高质量数据。ETL与ELT的主要区别在于转换步骤顺序,分别适用于不同规模数据场景。数据仓库通过ETL从多个数据源集成数据,支持分析决策。维度建模中的事实表记录业务指标,维度表提供上下文信息。缓慢变化维度(SCD)处理随时间变化的维度数据,常见类型包括直接覆盖型、新增版本型等。数据清洗解决数据缺失、重复、错误等问题,确保数据质量。数据血缘记录数据流转路径,便于问题排查和影响分析。常用ETL工具如Kettle通过转换和作业实现数

weixin_45729710的博客 1569

HDU 1048 The Hardest Problem Ever

Problem Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of t

努力ing!~ 688

C++实现SM4国密算法实战指南

通过以上实现,开发者可以快速在C++项目中集成SM4国密算法,满足金融、政务等领域的安全需求。实际部署时建议通过国家密码管理局的合规性检测,并定期更新密钥管理策略。库(支持国密算法),需提前安装并配置开发环境。

skyksksksksks的博客 1489

iPad 3」はフロントに「Face Time HD」カメラを採用し3月発売か紹介

iPad 3」はフロントに「Face Time HD」カメラを採用し3月発売か紹介 9 to 5 Macによると、独自のApple情報網を持っているiLoungeのJeremy Horwitz氏が次期iPadに関する情報をツィートしているそうです。その情報をまとめると、次期iPadはカメラの性能が向上し、フロントカメラはFace Time HDカメラになり、バックカメラはiPhone ...

weixin_30773135的博客 11万+

Linux虚拟机mysql安装教程(详细步骤)出现了一个错误:依赖检测失败

Linux虚拟机安装mysql的详细步骤(有报错预警哦)

m0_74953387的博客 5264

激光甲烷传感器DIY指南:从DFB激光器选型到Herriott池光路搭建

本文详细介绍了如何DIY激光甲烷传感器,从DFB激光器选型到Herriott池光路搭建的全过程。通过TDLAS技术实现ppm级甲烷检测,适用于家用燃气泄漏监测和农业沼气监测等场景。文章包含核心器件选型、光路搭建技巧、信号调理方案及系统集成优化,为创客提供实用指南。

f9g0h的博客 601

HEAP: Free Heap block XXXXXXXX modified at XXXXXXXX after it was freed

在有关于内存分配和释放的代码中,容易发生这种问题。这个问题的描述就是内存已经被释放了,后面还继续使用举个例子:float* distance = new float [dimension]; for(int k=0;k&lt;10;k++) {     for(int i=0;i&lt;dimension;i++)     {     distance[i]=0;     } delete[] d...

mons_xujingtao的博客 107万+

FPGA实战 —— 基于UART的多设备串口通信系统设计

本文深入探讨了基于FPGA的多设备UART串口通信系统设计。针对工业控制与物联网应用中一对多通信的需求,文章对比了共享总线式、多路独立式等硬件连接方案,并详细阐述了可配置UART IP核、波特率自适应算法以及多路数据仲裁与分发逻辑等核心设计要点。最后,通过一个四传感器采集节点的实战案例,展示了从硬件连接到Verilog代码实现的完整系统构建过程。

weixin_29172963的博客 238

java h d,Java, {Country} Hướng dẫn du lịch | Những việc nên làm tại Java, {Country} | Jetstar | Jets...

Là một trong những đảo nhỏ nhất của Indonesia nhưng cũng như các nơi khác trên khắp đất nước, Java được thiên nhiên ban tặng cảnh đẹp tự nhiên phong phú, từ bãi biển hoang sơ như Kepulauan Seribu trên...

weixin_34547628的博客 6万+

24位ADC的精度陷阱:为什么你的ADS1232实测性能不达标?

本文深入探讨了24位ADC芯片ADS1232在实际应用中性能不达标的原因,揭示了高精度ADC性能依赖周边电路设计的关键问题。通过分析电源系统、参考电压稳定性、PCB布局等常见陷阱,提供了优化方案和调试技巧,帮助工程师充分发挥ADS1232的潜力,实现接近理论值的测量精度。

weixin_28285943的博客 416

AI Agent在智能餐饮管理中的实践

本文章的主要目的是详细探讨AI Agent在智能餐饮管理中的实际应用。随着人工智能技术的飞速发展,餐饮行业也在积极寻求智能化转型,AI Agent作为一种具有自主决策和执行能力的智能体,为餐饮管理带来了新的机遇和解决方案。本文将涵盖AI Agent在餐饮管理各个环节的应用,包括订单管理、库存管理、员工调度、客户服务等方面,旨在为餐饮企业和相关技术人员提供全面的技术指导和实践参考。本文将按照以下结构进行阐述:首先介绍核心概念与联系,明确AI Agent和智能餐饮管理的定义和相互关系;

AGI×大数据,开启智能时代的认知跃迁;解码AGI,赋能数据驱动的智能革命。 1291

HDOJ-1702 栈和队列问题[或模拟]

ACboy needs your help again! Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1697    Accepted Submission(s): 906 Problem Description ACboy wa...

weixin_34226182的博客 552

SAP ABAP 接口管理服务(ZIF)开源项目介绍

接口管理服务(ZIF)开源项目基于 SAP ABAP系统,是一款对标SAP PI/PO 的轻量接口管理产品。他通过独立开发包部署在ABAP系统中,包含接口注册、接口管理、日志服务及其他配套功能,拥有丰富的技术沉淀并通过市场检验,目前已被多家企业应用在SAP ERP系统中。

SAP李斌,本人承诺所有原创文章均不使用任何AI生成技术,请大家放心阅读。 1753

HDU 1048

HDU 1048The Hardest Problem EverTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 26692 Accepted Submission(s): 12508Problem Description Juli

shallow_line的博客 568

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

HDU1047——Integer Inquiry,HDU1048——The Hardest Problem Ever,HDU1049——Climbing Worm

我们总是将一分钟的一部分计为一整分钟,如果尺蠖在攀爬结束时刚好到达井口,我们假设尺蠖成功爬出。您的工作是破译恺撒发送的消息并提供给您的将军。对于明文消息中的每个字母,您将其向右移动五位以创建加密消息(即,如果字母是“A”,则密文将是“F”)。开始行 - 一行,"START“,加密消息 - 一行,包含 1 到 200 个字符,包括恺撒的单个消息,结束行 - 一行,"END",在最后的数据集之后将是一行,"ENDOFINPUT"。输出:对于每个输入实例,在一行上生成一个整数,表示尺蠖爬出井口所需的分钟数。

u014114223的博客 1178

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

HDU1048 The Hardest Problem Ever

HDU1048   The Hardest Problem Ever方法一:对照输入输出字符,不难看出两者相差距离d=N-I,注意越界处理,若输出字符 方法二:由题意result[27]="VWXYZABCDEFGHIJKLMNOPQRSTU",将输入与输出相对应即可,对应公式:result[str[i]-A]即为所求。【code 1】#include#includei

Adam·Niuen 890

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

hdu_1048_字符串_水

传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1048 是在是不能再水的一道题,适合热身练习用。注意它每次都是读取一行,用c语言的gets也可以。 顺便放一下常用的asc码: 0—9: 48—57 A—Z: 65—90 a—z:  97—122 代码如下: #include #include #include #include

Allianzcortex_Technology_Blog 547

JAVA HDU 1048 The Hardest Problem Ever

题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1048 1 package hdu; 2 3 import java.io.BufferedInputStream; 4 import java.util.Scanner; 5 6 public class hdu_1048 { 7 8 publi...

weixin_30485291的博客 144

HDU1048 The Hardest Problem Ever

问题链接:HDU1048 The Hardest Problem Ever。入门训练题,用C语言编写程序。 以往,密码通信是一件重要的事情,是一项高技术的工作。不过译码的时候,通常是通过查密码本来实现的。这种方法依旧适用于现在这个计算机时代。 查表法仍然是一种好办法。有些程序员通过观察,找出编码规律,用程序来译码,程序没有通用性,不值得推荐和借鉴。 译码过程,使...

weixin_34081595的博客 106

hdu 1048 The Hardest Problem Ever(水题)

//hdu 1048 The Hardest Problem Ever(水题) /* 题意:就是改变大写字母。 解题:很水,字母根据这个公式改一下就行啦:s[i]=(s[i]-'A'+21)%26+'A'; */ #include #include #include using namespace std; char s[400]; int main() { while(gets(s)!=

u014068781的专栏 373

事件驱动架构落地十步法:从Outbox到事件溯源的工程实践

事件驱动架构(EDA)是一种以事件为核心协调分布式系统的软件设计范式,其本质是解耦服务、实现异步协作与最终一致性。理解EDA需突破‘请求-响应’的线性思维,掌握事件建模、可靠投递、幂等处理、版本演进等关键原理。技术价值在于提升系统弹性、支持业务快速迭代与零停机发布;典型应用场景包括订单履约链路、实时报表生成、风控决策审计等。本文聚焦工程落地,围绕Outbox模式保障事务一致性、事件溯源实现状态可追溯、以及事件网关统一治理等核心实践展开,将抽象概念转化为可调试、可验证、可监控的代码级方案。

weixin_34059951的博客 288

HDU1048

The Hardest Problem Ever Problem Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to surviv

wyj_2016的博客 279

hdu1048

Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of the first ciphers. This

HiBoyljw的博客 697
上一篇: hdu 1040
下一篇: hdu 1056
ysc504
博客等级 码龄16年 43粉丝 246原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值