HDU1048_The Hardest Problem Ever

java视频种子(超多30G) 全是学习的视频,2010传智播客struts2.1.8视频教程,张孝祥Java基础加强,还有面试题 立即下载

The Hardest Problem Ever

http://acm.hdu.edu.cn/showproblem.php?pid=1048

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


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 <stdio.h>
#include <string.h>
#include <stdlib.h>
main()
{
	char ch[1005] = { 0 };
	int len, i;
	char sh[1005] = { 0 };
	while (1)
	{
		gets(sh);
		if (strcmp(sh, "ENDOFINPUT") == 0)
			break;
		gets(ch);
		gets(sh);
		len = strlen(ch);
		for (i = 0;i < len;i++)
		{
			if (ch[i] >= 'F' && ch[i] <= 'Z')
				ch[i] = ch[i] - 5;
			else if (ch[i] >= 'A' && ch[i] <= 'E')
				ch[i] = ch[i] + 21;
		}
		for (i = 0;i < len;i++)
			printf("%c", ch[i]);
		printf("\n");
		memset(ch, 0, sizeof(ch));
		memset(sh, 0, sizeof(sh));
	}
	return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=1048
JAV LED32HD320 LAD.MV59S.B MT3151A04-1-XC-9 7J.rar JAV LED32HD320 LAD.MV59S.B MT3151A04-1-XC-9 7J JAV LED32HD320 LAD.MV59S.B MT3151A04-1-XC-9 7J 立即下载

相关推荐

jav.rar_JAV301_JAV388_JAV第8页_jav674_javclass.com

一些关于java程序的小练习。小型的程序。

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 ali

可可 の 猫 895

JAV.zip_jaV.H0D_jav.com_jav513_javjobvideo日韩_vjav

yrtos_ MULTITASKING RTOS,.

Java Code(Hard)

数学。

m0_46121643的博客 228

433MHz无线通信避坑指南:如何解决信号干扰和误码问题

本文深入探讨433MHz无线通信中的信号干扰和误码问题,提供从射频前端设计到协议优化的全链路解决方案。通过天线匹配、电源噪声抑制、曼彻斯特编码改进及实时频点切换等技术,显著提升通信稳定性和距离。适合智能家居和工业无线控制系统的开发者参考。

weixin_29288313的博客 423

CentOS 7下Oracle 11G RAC静默安装避坑指南:从网络规划到共享存储配置全流程

本文详细介绍了在CentOS 7环境下进行Oracle 11G RAC静默安装的全流程,包括网络规划、共享存储配置和系统参数调优等关键步骤。特别针对静默安装过程中的常见问题提供了实用的避坑指南和优化建议,帮助技术人员高效完成企业级数据库部署。

weixin_29234509的博客 130

接触JAV第一步HelloWorld

publlic  class HelloWorld{       public static void main(String args[]){              Systom.out.println("Hello World");      } }

java0201的博客 21万+

UE5网络同步优化:GetLifetimeReplicatedProps高级应用指南

本文深入探讨了UE5中GetLifetimeReplicatedProps函数的高级应用与优化策略。文章超越了基础变量注册,重点阐述了如何通过精细的复制条件控制、频率管理及分层复制机制,构建高效的数据同步通道,从而优化网络带宽与游戏性能,是提升多人游戏体验的实用指南。

weixin_29007243的博客 535

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的专栏 372

【图像检测】基于MATLAB的火灾监测系统设计

1 简介 针对传统火灾监测系统对于大空间的室内场合和开阔的室外环境易失效的问题,提出了一种结合火灾火焰特征和烟雾特征来进行判断的数字图像型火灾监测算法.火焰颜色特征是基于RGB颜色模型中的R,G,B三基色分量和它们之间的关系来判断是否有火焰发生,烟雾模型特征是图像灰度化预处理后,基于HIS空间模型提取的,通过计算像素点与基准像素点之间距离D的大小来判断是否有火灾发生.对提出的算法进行MATLAB仿真,并和传统的基于五种算子的边缘检测算法提取火焰烟雾特征进行对比.实验结果表明,提出的火焰特征和烟雾特征提取算

qq_59747472的博客 2797

Transformer在BEV感知中的统治地位

Transformer在BEV感知中的统治地位 ,人工智能,计算机视觉,大模型,AI,本文围绕 Transformer 在 BEV 感知中的统治地位展开,介绍了 Transformer 的基础原理,如自注意力、多头注意力机制等,以及 BEV 感知的概念、任务与挑战。阐述了 Transformer 在 BEV 感知中的技术优势,包括全局建模、灵活特征融合和长距离依赖捕捉能力,还介绍了典型架构、代码示例及在自动驾驶目标检测等领域的应用案例。同时,评估了其性能,提及优化方法,并展望了与其他技术融合、端到端系统等…

不踩坑,不知道坑有多深;不总结,踩过的坑白踩。 20万+

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 889

绕过App某加密企业版加固Frida检测

可以发现dlsym函数加载了两次pthread_create,可以认为这两个进程(或某一个进程)是和Frida的检测有关的,于是为了绕过检测,我们可以让它加载一个虚假的pthread_create函数,得到一个空结果绕过检测。成功绕过了libnllvm1717052779924.so的检测,又到了libface_nllvm.so的检测,使用同样的方法去绕过libface_nllvm.so的检测,代码我这里就不上了,大家可以自己修改以下。dlsym()函数的作用是在已经加载的动态链接库中查找指定符号的地址。

墨痕诉清风的博客 1626

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...

LightOn 707

STM32Cube高效开发教程<基础篇>(一)----概述

一、 STM32系列器件和开发工具发展历史声明:本人水平有限,博客可能存在部分错误的地方,请广大读者谅解并向本人反馈错误。本专栏博客参考《STM32Cube高效开发教程(基础篇)》,有意向的读者可以购买正版书籍辅助学习,本书籍由王维波老师、鄢志丹老师、王钊老师倾力打造,书籍内容干货满满。一、 STM32系列器件和开发工具发展历史。

我的博客 1173

【四足机器人实战】四足机器人运动学、动力学模型

认知有限,望大家多多包涵,有什么问题也希望能够与大家多交流,共同成长!四足机器人的运动学和动力学模型是其设计和控制的基础,涉及到如何精确描述和预测机器人在不同条件下的运动状态和行为本文先对四足机器人运动学、动力学模型做个简单的介绍,具体内容后续再更,其他模块可以参考去我其他文章运动学模型主要关注四足机器人的几何形态和时间序列下的运动特性,而动力学模型则进一步考虑了引起这些运动的力和扭矩的作用效果。运动学模型:运动学模型描述了四足机器人在没有考虑力的影响下的运动特性。

qq_35635374的博客 1057

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

老鼠 655

深度学习工具包 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")

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

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

u014114223的博客 1177

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

【HDU】1048 The Hardest Problem Ever

【代码】【HDU】1048 The Hardest Problem Ever。

多言数穷,不如守中。十语九中,未必称奇;一语未中,愆尤骈集。 268

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

hdu 1048 The Hardest Problem Ever

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

471

HDU 1048 The Hardest Problem Ever【水】

The Hardest Problem Ever Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21353 Accepted Submission(s): 10041 Problem Description J

希望的专栏 608

HDU-1048 The Hardest Problem Ever

See the article on https://dyingdown.github.io/2019/12/15/HDU-1048%20The-Hardest-Problem-Ever/ The Hardest Problem Ever Julius Caesar lived in a time of danger and intrigue. The hardest situation Caes...

yaoo_o的博客 302

HDU1048 The Hardest Problem Ever

The Hardest Problem Ever Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15790    Accepted Submission(s): 7298 Problem Description

长风的专栏 1520
上一篇: HDU1040_As Easy As A+B
下一篇: HDU1073_Online Judge
ZayneHuang
博客等级 码龄10年 5粉丝 116原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值