Eddy's digital Root hdu1163 数论

ORBSLAM3运行记录(单目+IMU) ORBSLAM3运行记录1.单目+IMU数据集运行记录自己做的其它测试2.单目+IMU自己采集数据运行记录测试结果 1.单目+IMU数据集运行记录 ORBSLAM3没有预留ROS下单目+IMU的结点,这个需要自己去写代码添加,可以参考这篇博客,《ORBSLAM3 用ROS接口运行双目IMU和单目IMU模式》。我的ROS结点为Mono-IMU,字典文件ORBvoc.txt在ORBSLAM3 / Vocabulary文件夹中,配置文件EuRoC.yaml在ORB_SLAM3 / Examples / Monoc 阅读详情

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

给出一个数n,求n^n的数根,数根即各位数字之和,如果这个和不是一位数,继续求这个数的各位数字之和,直到为一位数为止。

因为ab*ab=(10*a+b)*(10*a+b)=100*a*a+10*2*a*b+b*b=a*a+2*a*b+b*b=(a+b)*(a+b)

abc*abc=(100*a+10*b+c)*(100*a+10*b+c)

               =10000*a*a+2000*a*b+100*b*b+200*a*c+20*b*c+c*c

               =a*a+2*a*b+b*b+2*a*c+2*b*c+c*c

               =(a+b)^2+2*c*(a+b)+c*c

              = (a+b+c)*(a+b+c)

同理可以知道四位数,五位数也一样,

即n*n的数根=n的数根*n的数根。


求树根abc=a*100+b*10+c=(a*100+b*10+c)%9=a+b+c

当结果为0时,树根为9.


#include <iostream>
using namespace std;

int getroot(int n){
	int digital=0;
	while (n){
		digital+=n%10;
		n/=10;
	}	
	if (digital>9)
		return getroot(digital);
	return digital;
}

int main(){
	int n,m,k;
	while (scanf("%d",&n)!=EOF && n){
		k=getroot(n);
		m=1;
		while (n--){
			m=k*m;
			m=getroot(m);
		}
		printf("%d\n",m);
	}
	return 0;
}

从网上看到的某大神的代码。。

#include <stdio.h>
int main()
{
int n;
char s[20]="914942971915947978";
while(scanf("%d",&n)&&n)
{
   printf("%c\n",s[n%18]);
}
return 0;
}



从 central AAE 到 non-central AAE,重新理解 SAP PI 和 AEX 里的适配器引擎部署策略 摘要: SAP PI 项目中后期常面临运行时部署问题(如流量、隔离、权限等),而 Advanced Adapter Engine(AAE)是关键组件。AAE 分为 central(与集成服务器绑定,适合简单场景)和 non-central(独立部署,适合跨区域复杂网络)。non-central AAE 支持本地用户管理,增强独立性但增加治理复杂度。AEX(Java-only 轻量版 PI)与 non-central AAE 不同,前者是安装选项,后者是运行时部署方式。实际应用中,non-central AA 阅读详情

相关推荐

ArcGIS插值可视化气象数据

前言 地图底图的制作和气象数据的预处理见我上两篇博客 ArcGIS精美中国地图制作(详解) python处理日值气象数据 在前面我们已经将日值的地温数据处理成了年均地温,添加了站点经纬度坐标并导出为excel格式。 得到如下数据: 导入数据 在Arcmap中 文件-添加XY数据 将年均地温和站点位置数据导入。 注意:excel表格的格式要另存为97-2003工作簿形式,否则会有"arcgi...

江北20190411的博客 2万+

【题解】HDU1163 Eddy‘s digital Roots

原题链接:http://hdu.hustoj.com/showproblem.php?pid=1163 题目 Eddy’s digital Roots Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description The digital root of a positive integer is found by summing the digits of the i

Jourofant的博客 261

【C++】auto关键字(C++11,超详细解析,小白必看系列)

本文详细解析了C++中的“auto”关键字,介绍了其定义、基本用法、限制和高级用法,特别是与范围for循环和Lambda表达式结合的应用。

m0_73494049的博客 6万+

(HDU)1163 -- Eddy's digital Roots(Eddy的数根)

题目链接:http://vjudge.net/problem/HDU-1163 题意是求N的N次方这个数字各个数位上的数相加,得到一个数,反复步骤直至这个数只剩个位。 下面证明:一个数的数根(digital root)就是它对9的余数。 引用自维基百科Digital root&amp;lt;img data-rawheight="84" data-rawwidth="4...

diupouhao4253的博客 232

Redis 可视化工具 RedisInsight 的保姆级安装以及使用(最新)

Redis 可视化工具 RedisInsight 的保姆级安装以及使用(最新)

一名全栈小白的博客 1万+

FreeSWITCH视频通话实战:关键配置文件解析与编解码优化

本文详细解析了FreeSWITCH视频通话实战中的关键配置,重点介绍了如何通过修改`conf/vars.xml`和`sip_profiles/internal.xml`文件来启用媒体代理、优化编解码器设置(如H.264和VP8),并解决常见的视频流协商与网络穿透问题,帮助用户快速实现稳定、高质量的视频通话功能。

js777的博客 262

HDU1163 Eddy's digital Roots【九余数定理】

Eddy's digital Roots Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4436    Accepted Submission(s): 2505 Problem Description The d

长风的专栏 1047

EZ-USB-FX3 slavefifo调试

最近使用fx3-usb-3.0调试slave fifo的传输,期间遇到许多难以理解的问题。在这里分享给大家,希望可以少走一些弯路,我自己是这样走过来的。 1,首先去官网下载原始的参考设计,并安装所提供的SDK软件:FX3SDKSetup_1.3.4.exe 2,接着把参考设计文档AN65974阅读一遍,分别创建新的SDK工程和FPGA工程。如果使用的原厂的开发板,那么可以按照文档提示,可以很顺畅的跑完整过测试。否则需要匹配自己的硬件,做针对性的更改和移植,而我走的是后一条路,于是开始了漫长的调试之路。.

YDY5659150的专栏 3638

hdu1163 Eddy's digital Roots(快速幂 + 九余数定理)

Problem Description The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resu...

一身清贫怎敢入繁华 473

瑞芯微RK809音频驱动

瑞芯微RV1126中的RK809音频驱动开发

m0_61899715的博客 5229

VSCode 1.85便携版安装与配置:解决远程服务器glibc版本过低报错的保姆级指南

本文详细介绍了如何通过VSCode 1.85便携版解决远程服务器glibc版本过低导致的兼容性问题。通过环境隔离和版本固化的方法,开发者可以在老旧服务器上稳定运行Remote-SSH插件,同时保留主力VSCode的配置。文章提供了从下载安装到深度配置的完整指南,帮助用户快速搭建稳定的开发环境。

weixin_30279315的博客 584

hdu1163Eddy's digital Roots(九余数定理)

Eddy's digital Roots Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7780    Accepted Submission(s): 4217http://acm.hdu.edu.cn/showpr...

一只秀逗__的博客 278

《C#零基础入门之百识百例》(七)算数运算符 -- 圆的面积

运算符是一种告诉编译器执行特定的数学或逻辑操作的符号。C# 有丰富的内置运算符,本文带你学习C# 中算数运算符。

陈言必行 -- Unity游戏开发领域优质博主 3619

HDU 1163 余9定理

Eddy's digital Roots Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5513    Accepted Submission(s): 3047 Problem Description The digit

mkandysylove的博客 351

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

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

hdu1163

Eddy's digital RootsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2841    Accepted Submission(s): 1633 Problem Description The digital

rhy 345

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

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

出入栈 九度1547 卡特兰数 快速幂取余

慢慢也发现自己的确跟不上节奏了。明明ACM该是个狠好的选择。 可是时间至ciuic

operator456的专栏 1527

Statistics and Machine Learning Toolbox

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

新生晚会 hdu2519 组合数

http://acm.hdu.edu.cn/showproblem.php?pid=2519 求C(n,m); 30的阶乘超出了__int64. #include using namespace std; int main(){ #ifndef ONLINE_JUDGE freopen("2519in.txt","r",stdin); #endif int i,n,m,t,r; sc

operator456的专栏 999

n的m次方 bjfu1056

描述 你的任务是求N的M次方的结果。简单吧! 输入 输入有多组。每一组两个非负整数N(N 输出 每组结果占一行。结果在long long范围之内哦!!约定,0的0次方等于1。 样例输入 2 2 样例输出 4 #include using namespace std; __int64 power(__int64 n,__int64 m) { __int64 ret=1;

operator456的专栏 765

平面上的点 九度1548 叉积

题目:http://ac.jobdu.com/problem.php?pid=1548 题意:

operator456的专栏 745

求1和2的个数 九度1491

题目:http://ac.jobdu.com/problem.php?pid=1491 题意:给一个数,求比这个

operator456的专栏 735

Smith Numbers hdu1333 素数

http://acm.hdu.edu.cn/showproblem.php?pid=1333 题意:定义smith数为其分解质因数后所有质因数的数根和与其本身的数根和相等的数。 给出一个数,要求输出比该数大的smith数。(一开始因为没看清要输出比它大的数,而输出了大于等于该数的smith数,WA了几次) 记录一下自己求质因数的方法吧=w= 要记住一个数的质因数有且仅有一个可能大于它本身的

operator456的专栏 734

抽奖 bjfu1009 位运算

描述 现在社会上的抽奖活动简直是太多了。前段时间中国联通就举办了一个很无聊的抽奖活动,规则是每人可以向中国联通的短信系统发送一个实数,系统每天会从这些数字中选择一个无重复(就是有且只有一个)且最小的数,而发送这个最小数的用户就中奖了。现在我们也来设计一个抽奖系统。实数太麻烦,我们只考虑整数的情况。给你一堆整数,其中有且只有一个整数是唯一的,这个唯一的整数就是中奖数字,请写程序挑选出中奖数字。

operator456的专栏 535

Max Factor hdu2710 素数相关

http://acm.hdu.edu.cn/showproblem.php?pid=2710 按最大质因数排序,输出含有最大质因数的数。 比较简单的问题啦。 =w= #include #include #include using namespace std; #define N 20005 int factor[N]; void init(){ int k=floor(sqrt(

operator456的专栏 513

Factorial of large numbers bjfu1005 java实现大数阶乘

描述 Factorial, as we all know, is the product of all the positive integers from one up to and including a given integer. For example, factorial zero is assigned the value of one; factorial four is 1

operator456的专栏 498

素数 bjfu1012 素数筛选

描述 数论是ACM中用途很广的数学分支,而数论里研究得最多的问题,又都和素数相关,所以有人戏称数论为“素论”,也是不无道理的。 输入 输入首先包含一个整数T,表示测试数据组数,T不超过100。然后是T组测试数据,每组测试数据包含两个整数M、N,其中1 输出 对于每一组测试数据,请在一行内输出从M到N的所有素数,每个素数之间以逗号分开。 样例输入 3 1 10 1 1 5 7

operator456的专栏 481

How Many Fibs? hdu1316 高精度

http://acm.hdu.edu.cn/showproblem.php?pid=1316 大数我就用JAVA。 膜拜JAVA,JAVA无敌。 今天学会了用eclipse-java 调试。 F8跳到下一个断点,ctrl+shift+b设断点,F5、F6单步执行。 import java.math.*; import java.util.Scanner; public class Mai

operator456的专栏 444
上一篇: 前m最大的数 hdu1280 简单哈希
下一篇: 抽奖 bjfu1009 位运算
花酱_
博客等级 码龄14年 30粉丝 100原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值