Uva 10499 The Land of Justice

buildozer /home/chenyang/new_kivy/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Lib 阅读详情

Problem H
The Land of Justice
Input:
standard input
Output: standard output
Time Limit: 4 seconds

In the Land of Justice the selling price of everything is fixed all over the country. Nobody can buy a thing and sell it in double price. But, that created problems for the businessmen. They left their business and went to the production. So, after some days everybody was in production and nobody in business. And the people didn’t get their necessary things though the country was self-sufficient in every sector.

 

The government became very much anxious. But, they were intelligent enough to call the mathematicians.

 

The mathematicians gave a solution.  They suggested setting the surface area of an object as its selling-unit instead of its volume. Actually the clever mathematicians were very much interested to establish their own business.

 

Now, the government asks the programmers to build the software that would calculate the profit things.

 

Here your job is to calculate the business profit for a solid sphere. A businessman buys a complete sphere and to maximize his profit he divides it inn equal parts. All cut should go through the axis of the sphere. And every part should look like the picture below:

 

Input

You are given a sequence of integers N (0 < N < 231), indicating the numbers of parts of the sphere. The input file is terminated with a negative number. This number should not be processed.

 

Output

Calculate the profit over the sold pieces. The result should be in percentage and rounded to the nearest integer.

  

Sample input

2

2

-1

 

Sample output

50%

50%



题目大意:

由于政府的政策导致商家的减少,而此时数学家提出意见说一件物品以它的表面积为销售单位而不是体积。这种方法被政府接受了,数学家为了盈利其实也想经商。


问题如下:

就是给你一个球,本来的表面积特定的,但为了得到利润,把它劈开相同的大小的块,此时表面积肯定会增加,而相对于原来增加了多少的百分比,这就需要你去计算的。


题目解析:

初始球的表面积 4*pi*r*r,n=2时;即切一刀多了2个圆面积 2*pi*r*r,利润为50%,n=3时;多三个圆面积,利润为75%,以此类推

当n等分时,多n个圆面面积。


ans=(n*pi*r*r)/(4*pi*r*r)*100%=n/4*100%


#include<stdio.h>
#include<math.h>

int main() {
	double n;
	while(scanf("%lf",&n) != EOF && n>=0) {
		if(n == 1)
			printf("0%\n");
		else
			printf("%.0lf%\n",n*25);
	}
	return 0;
}


Mac安装Typescript报错 根本原因是系统级目录的权限限制。推荐通过修改目录权限或使用nvm彻底解决问题。 阅读详情

相关推荐

FFTW库安装与使用(3.3.5版本)

FFTW库安装与使用一、FFTW库介绍与下载二、FFTW库安装三、FFTW库测试 一、FFTW库介绍与下载   FFTW ( the Faster Fourier Transform in the West) 是一个快速计算离散傅里叶变换的标准C语言程序集,其由MIT的M.Frigo 和S. Johnson 开发。可计算一维或多维实和复数据以及任意规模的DFT,且运行速度比Eigen和opencv自带的FFT库函数快10倍以上。   下载链接:http://www.fftw.org/install/wind

Jhon_ranble的博客 2万+

UVA10499 The Land of Justice【水题】

In the Land of Justice the selling price of everything is fixed all over the country. Nobody can buy a thing and sell it in double price. But, that created problems for the businessmen. They left thei...

海岛Blog 628

【RF】Receiver Function接收函数:从理论到实践的深度解析

本文深入解析地震学中的接收函数(Receiver Function, RF)技术,从理论原理到实践操作。文章将RF比作地球的“听诊器”,详细阐述了其通过反褶积剥离震源影响、揭示地下结构(如莫霍面)的核心机制,并提供了使用Python和rf库进行数据处理、计算、动校正与叠加的完整实战流程,同时探讨了其应用、局限性与常见问题的解决方案。

Jerry的专栏 121

UVa 10499 - The Land of Justice

传送门 题意是输入把一个球切成的块数, 求出表面积增加的百分比. 水题.

一只冰熊 964

Unity2D像素刀光实现:粒子方向控制与像素级渲染规范

像素风游戏中的刀光特效并非普通粒子动画,而是需严格遵循像素艺术原理的视觉暂留模拟。其核心在于将‘瞬时切割感’转化为程序可执行的渲染逻辑:通过禁用纹理滤波保障1:1像素锐度,绑定刀锋向量控制粒子运动方向,限定≤0.15秒生命周期匹配人眼暂留阈值,并采用Stretched Billboard实现动态拉伸拖影。该方案兼顾美术语义(如直劈、横扫、突刺)与工程约束(Sorting Layer分层、对象池复用、单粒子GPU优化),广泛适用于Unity2D平台的动作反馈系统,尤其适配《空洞骑士》《死亡细胞》类高节奏像素R

weixin_32390647的博客 283

CoMP 协同多点传输技术

CoMP CoMP是什么 解决什么问题 有什么缺点 CoMP(Coordinated Multiple Points)协同多点传输,通信术语,LTE-A的重要技术之一。 CoMP传输是指地理位置上分离的多个传输点,协同参与为一个终端的数据(PDSCH)传输或者联合接收一个终端发送的数据(PUSCH),参与协作的多个传输点通常指不同小区的基站。CoMP技术将边缘用户置于几个基站的同频率上,几...

ilean_J的博客 2万+

UVA10499 The Land of Justice 的题解

表面积增加了百分之多少?输入以一个负数结尾,该负数不参与计算。

ZH_qaq的博客 195

CKAD-CN考试之路----12

显然,对应的value都已经实现了加密.保存退出,等待pod重新创建。确认secret是否被加密。编辑secret文件。

Q先生 446

UVA 10499-The Land of Justice

UVA 10499-The Land of Justice题目大意:切一个球,求增加的表面积。解题思路:根据球表面积公式4*pai*r^2和圆面积公式即可算出,注意,一刀时没增加。#include <stdio.h> #include <iostream> using namespace std; int main() { double a; while(scanf("%lf", &

ZeroLH00的博客 439

【数据分析】基于多组学数据整合的微生物与宿主互作网络构建及可视化分析

综上所述,本教程通过详细的步骤和方法,展示了如何整合微生物群落数据、宿主基因表达数据和代谢组数据,构建微生物与宿主互作网络,并进行可视化分析。这种方法为研究微生物与宿主之间的复杂关系提供了一种有力的工具,有助于推动相关疾病的研究和治疗。然而,在实际应用中,需要注意数据处理和分析过程中的各种问题,并结合实验验证来提高研究结果的可靠性和科学性。未来,随着多组学技术的不断发展和完善,以及数据分析方法的创新,相信我们能够更深入地理解微生物与宿主之间的互作机制,为疾病的预防、诊断和治疗提供更有力的支持。

专注生信领域 370

网规第三版:第4章网络资源设备(完结)

第 4 章 网络资源设备 调整内容: 更新主流网络设备(交换机、路由器、防火墙)的技术参数与选型标准 增加国产化网络设备与信创产品的相关内容 精简已淘汰的设备类型与技术指标

鹿鸣天涯 268

UVA-10499 The Land of Justice

UVA-10499 The Land of Justice 题目大意:商品不按照体积而是按照表面积来计算价格,第一刀无法切开,第二刀多了四个半圆面,之后每刀多两个半圆面。给出所切的刀数,输出增加表面积的比率。 positive result S = 1 or S = 4 or S = 78 negative result S = S35 experiment failed S = 9S4 expe

Tochase的博客 281

(8)(8.19) GPIOs

Ardupilot官网关于《Copter》的翻译 —《(8.19) GPIOs》。

无人机开发(开源Ardupilot) 1万+

UVA10499 - The Land of Justice

题目不太好懂,看了别人的翻译。大概意思就是,球形表面积增加量比上原表面积,其实就是n/4*100% 题目: Problem H The Land of Justice Input: standard input Output: standard output Time Limit: 4 seconds In the Land of Justice theselling

308

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

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

UVA 10499 The Land of Justice

UVA-10499题意:求且对球体如描述切 n 刀,求总共表面积相对原来的球体增加了多少个百分比。 解题思路:每切一刀都会增加 2 个半圆,增加的面积为 π*r^2,而球体表面积为 4*π*r^2,所以每刀多 25%,但是要注意只切 1 刀不增加。 要用long long ,因为 n 最大有 2^31-1, n*25 会超过int 的范围。/***************************

QzNarsh的博客 377

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

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

uva 10499 - The Land of Justice

The Land of Justice Input: standard input Output: standard output Time Limit: 4 seconds In the Land of Justice the selling price of everything is fixed all over the country. Nobody can buy a t

uva code 1381

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

uva 10499 The Land of Justice

所有做过的题目里面最简单的一道,但是要注意n=1的时候的特殊情况的处理。 #include #include void func(int n) { double res; if(n != 1) { res = n/4.0; res *= 100; } else { res = 0.0; } printf("%lld%%\n", (long long)floo

皓首不倦 不负少年 598

UVA - 10499 the Land of Justice

UVA - 10499 the Land of Justice题目大意:将一个圆从中间开始切 (不是整个切开) 问切N刀后 增加的表面积倍率 解题思路:第一刀是切不开的 2刀是多了4个面 后面每刀 多 2面。#include <cstdio> #include <cmath> int main() { long long int N; while (scanf("%lld", &

cwb15505905513的博客 264

UVA - 10499 The Land of Justice

2016-07-22 UVA - 10499 The Land of Justice 题目大意:求切了 n 刀后增加的表面积是原来的百分之多少。 解题思路:第一刀无法切开,第二刀多了四个半圆面,之后每刀多两个半圆面。 原始面积:4 × PI × r × r 一个半圆面:PI × r × r / 2 每刀增加两个半圆面即 1 / 4 化为百分数即 *25,精度问题直接

振丿Love 299

UVA10499 The Land of Justice

Problem H The Land of Justice Input: standard input Output: standard output Time Limit: 4 seconds In the Land of Justice the selling price of everything is fixed all over the country. Nobody

潜水的程序猿 700

uva-10499 - The Land of Justice

有一段时间没有写博客了,之前是因为考试,然后放假之后,为哥哥老是抢我的电脑用,我也只能做题,顾不上写博客,现在来到学校了,终于可以写了,不容意啊,泪奔~~~ 这道题目很简单,就是题意有点难以理解,对于我来说,理解题意,还是一大困难。。。。 题意:一个球的表面积是原先的值,然后把这个球过球心平均分成N份后的表面积和是后来的值,求后来的值比原先的值增加了百分之多少~~~ #include in

青竹梦 1475
上一篇: Uva 120 Stacks of Flapjacks
下一篇: Uva 748 Exponentiation (高精度幂运算)
HelloWorld10086
博客等级 码龄12年 88粉丝 614原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值