poj3299 Humidex

poj3299 Humidex(公式直接算) 水题 有一丢丢技巧的输入,再带上三个个公式的计算 代码思路和格式蛮漂亮的,可以借鉴 #include<iostream> #include<cmath> #define exp 2.718281828 using namespace std; double geth(double t,double d){ double h,e; e=6.11*pow(exp,5417.7530*((1/273.16)-(1/(d+273.16)))); h=0.5555*(e-10); r 阅读详情

Humidex
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 17719 Accepted: 6420

Description

Adapted from Wikipedia, the free encyclopedia

The humidex is a measurement used by Canadian meteorologists to reflect the combined effect of heat and humidity. It differs from the heat index used in the United States in using dew point rather than relative humidity.

When the temperature is 30°C (86°F) and the dew point is 15°C (59°F), the humidex is 34 (note that humidex is a dimensionless number, but that the number indicates an approximate temperature in C). If the temperature remains 30°C and the dew point rises to 25°C (77°F), the humidex rises to 42.3.

The humidex tends to be higher than the U.S. heat index at equal temperature and relative humidity.

The current formula for determining the humidex was developed by J.M. Masterton and F.A. Richardson of Canada's Atmospheric Environment Service in 1979.

According to the Meteorological Service of Canada, a humidex of at least 40 causes "great discomfort" and above 45 is "dangerous." When the humidex hits 54, heat stroke is imminent.

The record humidex in Canada occurred on June 20, 1953, when Windsor, Ontario hit 52.1. (The residents of Windsor would not have known this at the time, since the humidex had yet to be invented.) More recently, the humidex reached 50 on July 14, 1995 in both Windsor and Toronto.

The humidex formula is as follows:

humidex = temperature + h
h = (0.5555)× (e - 10.0)
e = 6.11 × exp [5417.7530 × ((1/273.16) - (1/(dewpoint+273.16)))]
where exp(x) is 2.718281828 raised to the exponent x.

While humidex is just a number, radio announcers often announce it as if it were the temperature, e.g. "It's 47 degrees out there ... [pause] .. with the humidex,". Sometimes weather reports give the temperature and dewpoint, or the temperature and humidex, but rarely do they report all three measurements. Write a program that, given any two of the measurements, will calculate the third.

You may assume that for all inputs, the temperature, dewpoint, and humidex are all between -100°C and 100°C.

Input

Input will consist of a number of lines. Each line except the last will consist of four items separated by spaces: a letter, a number, a second letter, and a second number. Each letter specifies the meaning of the number that follows it, and will be either T, indicating temperature, D, indicating dewpoint, or H, indicating humidex. The last line of input will consist of the single letter E.

Output

For each line of input except the last, produce one line of output. Each line of output should have the form:

T number D number H number
where the three numbers are replaced with the temperature, dewpoint, and humidex. Each value should be expressed rounded to the nearest tenth of a degree, with exactly one digit after the decimal point. All temperatures are in degrees celsius.

Sample Input

T 30 D 15
T 30.0 D 25.0
E

Sample Output

T 30.0 D 15.0 H 34.0
T 30.0 D 25.0 H 42.3

参考代码:

#include <iostream>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
int main(){
	
	char a;
	while (cin>>a){
		double t=200,d=200,h=200,e;
		if (a=='E')
			break;
		else if (a=='T')
			cin>>t;
		else if (a=='D')
			cin>>d;
		else
			cin>>h;
		cin>>a;
		if (a=='T')
			cin>>t;
		else if (a=='D')
			cin>>d;
		else
			cin>>h;
		if(h==200)  
            h=t+0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10);  
        else if(t==200)  
            t=h-0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10);  
        else if(d==200)  
            d=1/((1/273.16)-((log((((h-t)/0.5555)+10.0)/6.11))/5417.7530))-273.16;  
        cout<<setprecision(1)<<fixed<<"T "<<t<<" D "<<d<<" H "<<h<<endl;  
	}
	return 0;
}





北大POJ3299-Humidex编程题解 POJ在线判题系统中的题目涵盖范围广泛,从基础算法到复杂的数据结构设计,旨在锻炼参与者的编程思维与编码能力。这些题目不仅有助于理解理论知识,而且还培养了解决实际问题的能力。题目编号3299通常代表POJ中的一个具体编程挑战题目。这个特定的题目可能是关于算法设计、数据结构应用、数学问题、字符串处理等方面的一个具体实例。此题目旨在考察参与者对于特定编程问题的理解,以及使用计算机语言实现解决方案的能力。题目编号3299是POJ(北京大学在线评测系统)中的一个典型算法问题。 阅读详情

相关推荐

Humidex:湿度指数(“湿度指数”的缩写)是一种用于通过结合热和湿度的影响来描述普通人感觉天气有多热的量表。 (这是加拿大 Humidex 不是美国热量指数)

Humidex 湿度指数(“湿度指数”的缩写)是一种用于通过结合热和湿度的影响来描述普通人感觉天气有多热的量表。 (这是加拿大 Humidex 不是美国热量指数)。 您可以在查看正在运行的 PHP 示例代码。 我最初编写这个软件是我在 2015 年夏季从事的物联网项目的一部分,但我找不到可以计算 Humidex 的 PHP 代码,所以我发布了我自己的版本。 感谢您花时间看这个项目,希望对您有用, 康纳沃尔什。

Humidex

Humidex Time Limit:1000MS Memory Limit:65536K Total Submit:24 Accepted:15 Description Adapted from Wikipedia, the free encyclopedia The humidex is a measurement used by Canadian meteorologists

ACM 2081

ECU-TEST 快速入门

ECU-TEST 是由位于德国德累斯顿的TraceTronic公司开发的一款用于嵌入式系统测试验证软件工具。自从2003年首次发布ECU-TEST ,该软件成为了汽车ECU开发的标准工具 ,同时也逐步成为了重型机械和工业自动化开发的标准工具 。该软件是起源自于一个控制单元的系统化测试的项目研究,从而为从德累斯顿工业大学脱离出来的TraceTronic公司奠定了基础。ECU-TEST旨在完成测试案例的规范化、评估、求解和归档。得益于该软件包含大量的自动化测试方法使得测试案例的所有必要功能如创建、求解和评估

wangying202的博客 1万+

算法课作业1

就把中间通道编号,奇数和偶数的编号调成1-200,之后对区间进行累加,重合次数最多的就是最小时间。注意坑就是,区间不一样从小到大,l,r要判断一下大小。两排都是房间,一排两百个房间,上面按奇数,下面按偶数编号,之后房间两两之间要搬桌子,搬桌子期间中间通道全部占用,可同步进行,搬一次10分钟,求最小时间。求e的对数有log函数,不懂为什么不会出精度错误,很迷,给的三个数字也没有顺序,需要多判断。给三个类型数字通过公式来回转化。

qq_67586914的博客 428

【simulink模型】独立悬架振动模型,七自由度整车simulink模型

车辆悬架系统的设计对提升车辆行驶平顺性和操纵稳定性具有重要意义。本文构建了独立悬架的振动仿真模型以及七自由度整车动力学模型,基于 Simulink 平台实现对模型的动态响应仿真。通过对比不同工况下的车辆振动响应,验证了模型的准确性与实用性。研究结果为车辆悬架系统的优化设计提供了有力支持。

2401_84610415的博客 1582

Windows下快速搭建MSYS2开发环境(含GCC与MinGW配置)

本文详细介绍了在Windows系统下快速搭建MSYS2开发环境的完整流程。通过使用pacman包管理器,可以便捷地安装GCC编译器与MinGW-w64工具链,并配置系统环境变量。文章还涵盖了从基础安装、系统更新到编译开源项目的实战指南,帮助开发者高效构建原生Windows程序,显著提升C/C++开发效率。

weixin_29213827的博客 539

poj 3299 Humidex

Humidex Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9883 Accepted: 3755 Description Adapted from Wikipedia, the free encyclopedia The humidex is a mea...

weixin_30955341的博客 305

ChatUI vs Ant Design X 技术选型对比

维度ChatUI优势轻量级、易上手、完美兼容 Ant Design全能型框架、企业级扩展性、深度模型集成局限性功能单一、缺乏高级交互支持学习曲线陡峭、包体积较大最佳实践单独聊天窗口集成整体智能助手系统开发通过对比可见,ChatUI 适合快速实现基础对话功能,而Ant Design X 更适合构建复杂的 AI 驱动应用。实际选择时需结合项目规模、团队技术栈和对交互复杂度的需求综合评估。

四楼没电梯的专栏 2262

程序证明与形式化验证:从理论到工程实践

程序证明作为计算机科学的重要分支,旨在通过数学方法确保软件行为的绝对正确性。其核心原理是形式化验证,即使用形式化语言对系统进行精确描述,并通过逻辑推理证明其满足特定属性。这项技术的价值在于能够提供超越传统测试的逻辑完备性保证,从根本上提升软件的可信度。在工程实践中,形式化验证已应用于安全关键系统、密码学实现、操作系统内核等场景,通过自动化工具链(如SMT求解器)降低验证负担。例如,Project Everest项目采用分层验证策略,聚焦于构建完全形式化验证的HTTPS协议栈,为互联网安全通信打造数学意义上的

weixin_30325971的博客 360

【超详细】数据分析笔试题分享,可以收藏后仔细阅读_数据分析岗位笔试题目

这种做法是最精确的做法,保留了所有的信息,也未添加任何额外信息,若预处理时把所有的变量都这样处理,会大大增加数据的维度。15、在某座城市出现了某种流行病,且已知某座城市男女人数相同,男性患该病的概率为5%,女性为0.25%,现已知该城市的小明得了此病,请问小明为男性的概率是() B。D项,使用方差作为特征评分标准,如果某个特征的取值差异不大,通常认为该特征对区分样本的贡献度不大,因此在构造特征过程中去掉方差小于阈值的特征。LTV,用户生命周期价值,是产品从用户获取到流失所得到的全部收益的总和。

2401_89824744的博客 948

Python爬虫实战:研究Pandas,构建车质网各车型数据采集和分析系统

研究结果表明,通过网络爬虫技术可以有效地获取公开的汽车投诉数据,这些数据经过适当的清洗和处理后,可以揭示出丰富的汽车质量信息。)作为国内专业的汽车质量投诉受理平台,自 2010 年成立以来,已累计接收消费者投诉信息超过 200 万条,这些数据包含了车型、投诉时间、投诉问题、处理状态等多维度信息,具有极高的分析价值。:通过对车质网数据的分析,能够挖掘出有价值的汽车质量信息,为消费者购车提供参考,为汽车厂商改进产品质量和服务提供依据,同时也能为相关监管部门提供数据支持。

ylfhpy的博客 938

POJ 3299 Humidex Java题解

本文主要是针对POJ-3299-Humidex使用Java实现的相关过程,以及初学者的注意事项。

Exticntion的博客 748

Python爬虫实战:利用Playwright和反反爬技术高效抓取Bloomberg金融数据

用户行为分析(鼠标移动、点击模式)请求头检测IP频率限制WebSocket通信验证Canvas指纹识别我们的爬虫需要模拟人类行为,使用代理IP池,并合理控制请求频率。

2201_76125261的博客 1020

POJ3299 -- Humidex

POJ3299 -- Humidex Submit1:Wrong Answer #include #include int main(){ char flag; double temperature,dew_point; while(scanf("%c",&flag)!=EOF&&flag!='E'){ scanf(" %lf D %lf",&t

360

OpenClaw人人养虾:接入即时通讯平台Zalo

通过 Zalo Official Account(OA,官方账号)API,可以将 OpenClaw 接入 Zalo,实现面向越南用户的自动化客服和互动。

王国平的博客 437

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

POJ3299 Humidex

//1_4_2: Humidex 湿热指数,温度和露点之间的关系 POJ3299 #include #include #include #include using namespace std; double get_hum(double tem,double dew) { return tem + 0.5555 * (6.11 * exp(5417.7530 * ((1 / 273.1

364

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

POJ3299-Humidex

转载:http://blog.youkuaiyun.com/lyy289065406/article/details/6642582 POJ3299-Humidex 提示:纯粹的数学公式,连推导公式都可以省了= = //Memory   Time    //240K      0MS       #include   #include   #include

saishangxue123的专栏 405

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

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

Statistics and Machine Learning Toolbox

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

POJ 刷题系列:3299. Humidex

POJ 刷题系列:3299. Humidex传送门:POJ 3299. Humidex题意: 给定T, D, H中的任意两个数,求另外一个。 思路: 公式由题目给定,如下: humidex = temperature + h h = (0.5555)× (e - 10.0) e = 6.11 × exp [5417.7530 × ((1/273.16) - (1/(dewpoi

Demon-初来驾到 1626

POJ 3299 Humidex

Adapted fromWikipedia, the free encyclopedia The humidex is ameasurement used by Canadian meteorologists to reflect the combined effect ofheat and humidity. It differs from the heat index used in the

emoheithree的博客 428

POJ - 3299 Humidex

Humidex Time Limit: 1000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u Submit Status Description Adapted from Wikipedia, the free encyclopedia The humidex

acm_1361677193的专栏 351

Poj 3299 Humidex

1.链接: http://poj.org/problem?id=3299 2.题目: Humidex Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 16705   Accepted: 6078 Description Adapted from Wikip

西门求雪的专栏 383

POJ 3299.Humidex

题目:http://poj.org/problem?id=3299 AC代码(C++): #include #include #include #include #include #include #include #include #include using namespace std; int main(){ double t; double d;

njyexiong的博客 299

Poj3299——Humidex

题目 T he humidex is a measurement used by Canadian meteorologists to reflect the combined effect of heat and humidity. It differs from the heat index used in the United States in using dew point rath...

qq_42770849的博客 406
上一篇: poj1845 Sumdiv
下一篇: poj2159 Ancient Cipher
JinbaoSite0144
博客等级 码龄12年 231粉丝 157原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值