hdu 1018 - Big Number

MiniOSD DIY记 最近迷上了航模,研究了很多东西,感觉路走的长了还是适当要停下脚步休息下总结下。 这次DIY的是一块OSD设备,主要用于航模图传的叠加显示,原理也很简单就是atmel atmega328p+MAX7456芯片,网上卖的成品基本上都是一个原理图。 原理图 我按照我自己的需要做了适当的更改,去掉了DC-DC电路,直接用5V输入,因为摄像头都是5V的,所以DC-DC不是很有必要,体积上更加小了点, 打... 阅读详情
Problem Description
In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in the factorial of the number.
 

Input
Input consists of several lines of integer numbers. The first line contains an integer n, which is the number of cases to be tested, followed by n lines, one integer 1 ≤ n ≤ 10 7 on each line.
 

Output
The output contains the number of digits in the factorial of the integers appearing in the input.
 

Sample Input
  
2 10 20
 

Sample Output
  
7 19
 

Source



=====================================


求一个数有N多少位:log10(N)+1
所以log10(1*2*3*……*n)+1=log10(1)+log10(2)+……+log10(N)+1


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
    int t,n;
    cin>>t;
    while(t--)
    {
        double sum=0;
        cin>>n;
        for(int i=1;i<=n;i++)
        {
            sum+=log10((double)i);
        }
        cout<<(int)sum+1<<endl;
    }
    return 0;
}


地瓜机器人RDK Studio使用入门教程 不知道大家在使用AI开发板的时候有没有遇到过板子官方镜像占据空间大难以保存,想要的时候找不到?官方示例项目久而久之便难以找寻?首次登陆开发板连接网络还需要准备显示器键盘鼠标外设繁杂?…为了解决平时开发过程中遇到的种种不便利问题,地瓜机器人创新的推出了RDK Studio这一官方开发者软件,使智能机器人开发迎来新纪元!通过这一软件极大降低了机器人的开发门槛,哪怕是零基础的用户亦可轻松上手RDK系列板卡! 阅读详情

相关推荐

【数据分析与挖掘实战】金融风控之贷款违约预测详解1(有代码和数据集)

金融风控一.题目理解1.1.题目概况1.2数据概况1.3预测指标二.数据来源三.查看数据四.分类指标计算示例4.1混淆矩阵4.2准确度4.3precision(精确度),recall(召回率),f1-score4.4P-R曲线4.5ROC曲线4.6AUC曲线4.7KS值五.数据分析5.1基本信息5.2查看数据集中特征缺失值,唯一值等5.3查看特征的数值类型有哪些,对象类型有哪些5.3.1数值连续型变量分析5.3.2非数值类别型变量分析5.3.3总结:5.4变量分布可视化5.4.1单一变量分布可视化 更新中~

m0_49263811的博客 1万+

杭电OJ题1018 Big Number 解题报告

Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 18173    Accepted Submission(s): 8167 Problem Description In many ap

Emacs_Linux的专栏 766

Miniconda入门:在CentOS上的安装、基本操作、目录结构、卸载

Miniconda是一个 免费的 轻量级的 conda安装程序 它只包含conda、Python、pip、zlib等基础的文件和依赖包 使用conda install命令可从Anaconda存储库中安装额外的conda包 简介 下载 安装 基本操作 虚拟环境的操作 包的操作 目录结构 卸载

ArYe 1万+

BigNumber解决js基本运算精度问题

2、基于BigNumber在项目中封装基本的四则运算。BigNumber解决js基本运算精度问题。// 导入加减乘除计算方法。

weixin_46252229的博客 795

SolidWorks软件二次开发:使用C#进行SolidWorks二次开发

SolidWorks 提供的 API(应用程序编程接口)允许开发者使用多种编程语言(如 C#、VB.NET 等)来控制和扩展 SolidWorks 的功能。API 架构基于 COM(组件对象模型),这意味着开发者可以通过引用 SolidWorks 的类型库来访问其对象模型。SolidWorks 的对象模型包括了从文档、零件、装配体到特征、草图等所有 SolidWorks 中可操作的对象。

kkchenjj的博客 3215

iqoo11如何获取root权限?

🏆本文收录于专栏,主要记录项目实战过程中所遇到的Bug或因后果及提供真实有效的解决方案,希望能够助你一臂之力,帮你早日登顶实现财富自由🚀;同时,欢迎大家!持续更新中,up!up!up!!

**My Coding Family** 5823

前端使用bignumber.js,解决浮点和精度问题

vue浮点经度问题

Gaoju_liz的博客 3433

Temporal Noise Reduction(TNR)时序去噪技术解析:原理、平台实践与工程调优路径

随着高画质夜景拍照和高清视频拍摄需求的持续增长,图像传感器在低照度环境下输出信号的噪声问题日益突出。相比空间域降噪(SNR),时序去噪(Temporal Noise Reduction, TNR)利用帧间信息进行融合处理,具备更高的信噪比提升效率及更强的边缘保护能力,已成为移动影像ISP链路中的核心环节。本文系统剖析TNR的算法原理、平台实现机制与工程调试路径,并基于实际开发案例分析其在不同场景下的效果差异及调优方法,为工程师提供从理论到实操的完整路径参考。

努力分享一些人工智能、计算机视觉、影像等相关的知识干货! 3202

杭电OJ-ACM1018 (Big Number)

ACM1018

m0_73891157的博客 434

MimicKit 人形机器人强化学习全身模仿控制算法使用教程

本文介绍了MimicKit运动模仿算法框架的使用指南。主要内容包括:1)安装IsaacGym和依赖项;2)训练模型命令及参数说明;3)测试模型的方法;4)分布式训练配置;5)使用TensorBoard可视化日志;6)动作数据格式说明。该框架支持DeepMimic、AMP、ASE、ADD等算法,包含PPO、AWR等强化学习算法,适用于物理仿真角色动画控制研究。

机器人控制与仿真应用 1201

青少年C/C++软件编程(四级)等级考试真题及答案解析目录

3. 带通配符的字符串匹配。1. 怪盗基德的滑翔翼。3.最长公共子上升序列。4.宠物小精灵之收服。

长春高老师编程 3033

bigNumber.js

bigNumber.js

故里的博客 677

2025年CSP-J复赛真题及题解:T4 多边形(polygon)

2025年CSP-J复赛真题及题解:T4 多边形(polygon)

王老师青少年编程 1718

HDU-1018 Big Number

HDU 1018 Big Number In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number...

你呢的博客 1092

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

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

hdu1018Big Number

Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 43080    Accepted Submission(s): 21057http://acm.hdu.edu.cn/showproblem.ph...

一只秀逗__的博客 264

Camera2Demo

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

HDU1018 Big Number

题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1018网上有求解的数学公式,#includeiostream>#include cmath>using namespace std;int main(){    int caseNum,i,j,n,count;    double sum;    while (cin>>caseNum)

672

Statistics and Machine Learning Toolbox

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

hdu 1018 Big Number

hdu 1018 Big Number In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are g...

博客——XiaoTang 299

HDU 1018 Big Number

Problem Description In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you ar

超 4070

【HDU】1018 Big Number

【代码】【HDU】1018 Big Number。

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

hdu1018 - Big Number

http://acm.hdu.edu.cn/showproblem.php?pid=1018 同题不同解 数学推导

moonspiritacm 416

hdu 1018 Big Number

hdu 1018   Big Number        题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1018 数学水 题目大意:输入n,输出n!有多少位。 题目分析:用到的知识点是 1、lg10(n)+1=n的位数 ;2、lg(1+2+……+n)=lg(1)+lg(2)+lg(3)+……+lg(n)。 #include #include

slicer的技术交流栈 778

ACM-数论之Big Number——hdu1018

ACM 数论 Big Number hdu1018 斯特林公式

继续激情,继续奋斗。 2323
上一篇: int,long,long long,float,double范围
下一篇: hdu 1071 - The area
coco430
博客等级 码龄14年 9粉丝 107原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值