hdoj1063

杭电OJ(HDOJ)1063题:Exponentiation(大数操作——幂运算) 题意: 操作数有多行,每一个输入一个浮点数R(0,99.99)和一个整数n(0,25],求出R^n。不可使用科学计数法表示结果,如果结果小于1,只输出小数点和小数部分。 示例输入: 95.123 12 0.4321 20 5.1234 15 6.7592  9 98.999 10 1.0100 12 示例输出: 548815620517731830194541.899025 阅读详情

Exponentiation

Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 4187    Accepted Submission(s): 1122


Problem Description
Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many computer systems. 

This problem requires that you write a program to compute the exact value of R n where R is a real number ( 0.0 < R < 99.999 ) and n is an integer such that 0 < n <= 25. 
 

Input
The input will consist of a set of pairs of values for R and n. The R value will occupy columns 1 through 6, and the n value will be in columns 8 and 9.
 

Output
The output will consist of one line for each line of input giving the exact value of R^n. Leading zeros should be suppressed in the output. Insignificant trailing zeros must not be printed. Don't print the decimal point if the result is an integer.
 

Sample Input
  
95.123 12 0.4321 20 5.1234 15 6.7592 9 98.999 10 1.0100 12
 

Sample Output
  
548815620517731830194541.899025343415715973535967221869852721 .00000005148554641076956121994511276767154838481760200726351203835429763013462401 43992025569.928573701266488041146654993318703707511666295476720493953024 29448126.764121021618164430206909037173276672 90429072743629540498.107596019456651774561044010001 1.126825030131969720661201
 

Source
 

Recommend
PrincetonBoy



import java.util.Scanner;
import java.math.*;


public class Main {


    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            BigDecimal a;
            a = in.nextBigDecimal();
            int n = in.nextInt();
            a = a.pow(n);
            a = a.stripTrailingZeros();
            String str = a.toPlainString();
            if (str.charAt(0) == '0') {
                str = str.substring(1);
            }
            System.out.println(str);
        }
    }
}


maya权重拷贝一对一,一对多 是不是有时候盔甲很多很碎头很大,用代理一个个拷贝很麻烦吧 用下面代码直接运行进行一对多或者一对一拷贝 第一个先选择参考物体,加选其他一堆有的没的有权重或没权重的物体执行一键拷贝,就可以啦 以下是源码送上,带走吧 ------------------------ #! -*- coding:utf -8 -*- #author:liubingdong #date:20... 阅读详情

相关推荐

大语言模型无代码构建知识图谱概述

由示例可以看出,大语言模型的泛化能力能够非常精准的抽取文本中的实体、关系等知识信息。其能够大大提升知识提取的效率与准确性。HuggingFists低代码平台的出现进一步促进了知识图谱构建的效率。它大幅降低了知识图谱构建人员的技术要求,使得从事该工作的人员有了更大的选择范围。不断下降的构建成本,意味着可以有更多的客户享受到知识图谱带来的业务价值。

colorknight的专栏 1817

HDU-1063 Exponentiation

HDU-1063 Exponentiation AC代码及题解

包络面的博客 267

手把手教你用STM32F103的IO口模拟XY2-100协议驱动数字振镜(附Keil O3优化代码)

本文详细介绍了如何使用STM32F103的IO口模拟XY2-100协议驱动数字振镜,包括协议解析、偶校验算法、寄存器级优化及Keil O3编译下的性能调优。通过硬件配置、核心代码实现和优化技巧,帮助开发者实现高速二维偏转控制,适用于工业激光雕刻和精密定位系统。

weixin_42527401的博客 260

java安装1063报错_【大数】——hdu1063——值得学习的Java技巧

ExponentiationTime Limit: 2000/500 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9046Accepted Submission(s): 2625Problem DescriptionProblems involving the compu...

weixin_42386361的博客 947

基于STM32的多参数水质检测仪系统 | 保姆式教程 开源可复刻

本项目基于STM32F103C8T6主控,搭配pH、TDS、浊度、水温四大核心水质检测模块,完整实现了多参数水质检测仪的全流程开发,从多通道ADC采集、数字滤波、温度补偿、专业校准、阈值报警到人机交互,全流程无跳步保姆式拆解,配套逐行注释可直接编译的开源代码,新手跟着步骤一步步操作,就能顺利完成项目复刻

ZhongWeiXiang9的博客 484

Java后端中的链路追踪:使用OpenTelemetry实现全链路监控

在现代的微服务架构中,链路追踪是监控和优化系统性能的关键技术。通过链路追踪,我们可以跟踪请求在系统中的流转,识别性能瓶颈,定位问题根源。本文将介绍如何在Java后端应用中使用OpenTelemetry实现全链路监控,包括具体的实现步骤和代码示例。通过集成OpenTelemetry,您可以实现全面的链路追踪,帮助您识别瓶颈和潜在问题,从而提升系统的可靠性和用户体验。OpenTelemetry是一个开源项目,旨在提供统一的工具集来收集、处理和导出应用程序的遥测数据,包括跟踪、度量和日志。

聚娃科技开发者博客 1727

(HDU 1063)Exponentiation(c++实现)

Description Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many compu

ROOM 1986

SimpleFOC STM32实战:基于F103与HAL库,剖析速度环与电流环的协同控制

本文详细介绍了基于STM32F103与HAL库的SimpleFOC实战应用,重点剖析速度闭环控制与电流环的协同工作原理。通过开发环境搭建、参数调试技巧及性能优化方案,帮助开发者高效实现无刷电机精准控制,适用于机器人、无人机等高精度应用场景。

weixin_29170327的博客 476

hdu1063

做了一天多,想死。。。 第一个bug: 超内存了!!开始在main函数里面没有超内存,但是在调用的函数里面有定义了很大的数组,就超内存了,导致程序崩溃。以前还没有遇到过这种情况。(看不懂汇编语言),自己一点一点去推测的。 第二个bug: 没有对temp清空,第一次输入"12345\0",第二次输入"as\0",因为想让输入的都是小数形式,如果第二次输入的是整数,就在后面补".0\0"这就出...

qq_41755258的博客 339

第五节 Amesim《直动型溢流阀HCD建模》HCD5 学习资料

利用HCD原则创建直动型溢流阀的界面。这可能包括图形化表示直动型溢流阀的工作原理、操作方式和调节方法。这样的界面应当直观且易于理解,使用户能够轻松了解阀门的功能和使用方法。

m0_58052642的博客 1330

HFSS 3D LAOUT PCB 裁剪,差分线,过孔仿真和优化

我本身不是做天线设计的,所以HFSS这个软件给我主要还是做PCB级别的高速信号完整性仿真,一般2.5D的仿真软件无法对过孔和跨平面进行仿真。所以要借助三维电磁软件进行。今天就针对PCB进行裁剪。为什么要裁剪?以为如果把整个PCB一起仿真的话,应该要好几个月吧。所以为了加快仿真速度,必须进行裁剪仿真。①candence的PCB可以直接导入。那么先导入brd文件,file-import-candence结果如下②点击cutout,选中要仿真的net和参考平面。这里最好选creat new不然会把原文件覆盖掉。注

gjatwfn的专栏 1万+

hdu-1063 Exponentiation大数问题

这个题题意很简单 ,求浮点数R的N次方。 刚看到这个题,直接就开数组模拟大数乘法,写了半天Memory Limited Exceed.不过由此知道了int型数组的最大长度是8*10^7,char 型2*10^7 后来就想到了数据不会太多,就转成了每输入一次,计算一次。写呀写呀,一直WA。各种特殊数据嗄。写的头大。删了重写了很多次。也许是以前写题的时候没有全心的投入吧,细节的部分一多就会慌张,一...

java开发指南博客 【转载】 167

NVIDIA Isaac GR00T N1 入门教程(一) 人形机器人多模态大语言模型

英伟达™ Isaac GR00T N1 是世界上首个用于通用仿人机器人推理和技能的开放式基础模型。该跨体模型采用多模态输入(包括语言和图像)在不同环境中执行操作任务。GR00T N1 在一个庞大的仿人机器人数据集上进行训练,该数据集包括真实捕获数据、使用英伟达 Isaac GR00T Blueprint 组件生成的合成数据(神经生成轨迹示例)以及互联网规模的视频数据。通过后期训练,它可以适应特定的应用、任务和环境。

2506_90492529的博客 3049

HDOJ 1063 Exponentiation

题意:给出两个数n和m,求n^m的值 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1063 思路:java,BigDecimal类 注意点:注意科学计数法和前、后导零 以下为AC代码: Run ID Submit Time Judge Status Pro.ID Exe.Time Exe.Memory Co

luminous11的专栏 510

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

java下载错误代码1063_HDOJ 1063 HDU 1063 Exponentiation JAVA 编写 ACM 1063 IN HDU

ExponentiationTime Limit: 1000/500 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1696Accepted Submission(s): 376Problem DescriptionProblems involving the compu...

weixin_42112894的博客 385

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

HDOJ 1063 && POJ 1001

HDOJ1063和POJ1001是相同的题目,但是就此题而言,POJ的数据要弱于HDOJ。 此题是高精度幂运算,在POJ上能AC的代码却在HDOJ上AC不了,后来仔细阅读题目才发现,程序中没有处理前导0的部分,就是说001.01得处理为1.01。 经过实际测试,加上处理前导0的功能,既可以在HDOJ上AC,也可以在POJ上AC;如果不加处理前导0的功能,只能在POJ上AC。这就是许多像我一样的

Sun_tester的专栏 999

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

HDOJ 1063

Exponentiation Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5659    Accepted Submission(s): 1554 Problem Description Problems inv

XMzhou的专栏 971

【HDOJ】1063 Exponentiation

这道题目莫名其妙的wa,又莫名其妙的过了。 1 import java.util.Scanner; 2 import java.math.BigDecimal; 3 4 public class Main { 5 public static void main(String[] args) { 6 Scanner cin = new Scann...

weixin_33726313的博客 128

HDOJ1063大数相乘

import java.math.BigInteger; import java.util.Scanner; import java.math.BigDecimal; import java.io.*; public class Main { public static void main(String[] args) { Scanner cin=new Sc

不要挡住我的阳光 452

hdoj 1063 Exponentiation 【大数精准次幂】

策略:将实数转化成整数, 记录下小数的位数, 最后的时候将前导0和后导0去掉输出就好了 ac by :SWS 题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1063 代码: #include #include int main() { char s[10]; int ans[250], n, i, j, d; while

shengweisong 1112

ACM HDOJ 1063 (Exponentiation)

题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1063 import java.math.BigDecimal; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scn = new Scanne

陈青杨 580

【大数问题】 HDOJ 1063 Exponentiation

实数大数~~~ import java.util.Scanner; import java.math.BigInteger; import java.math.BigDecimal; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in);

yysys 591
上一篇: hdoj1047
下一篇: hdoj1715
lulining
博客等级 码龄15年 8粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值