Test SRM Level One: TemperatureScales
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=6038
因为TopCoder SRM比赛使用的编译器进行了升级,所以进行了一次Test SRM,这次比赛不计rating. 题目是从SRM 200 -400间随机选择的。
这道题目就是解一个二元一次方程。
代码如下:
#include <iostream> using namespace std; class TemperatureScales
{
public:
double convert(int f1, int b1, int f2, int b2, int t);
}; double TemperatureScales::convert(int f1, int b1, int f2, int b2, int t)
{
double a, b; a = ( (double)(f2 - b2) ) / (f1 - b1);
b = ( (double)(f1*b2 - f2*b1) ) / (f1 - b1);
return (double)(a * t + b);
}
Test SRM Level One: TemperatureScales的更多相关文章
- Test SRM Level Two: CountExpressions, Brute Force
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=8157 这道题目跟扑克牌算24的题目比较像,但要简单一些.点击查 ...
- Test SRM Level Three: LargestCircle, Brute Force
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3005&rd=5858 思路: 如果直接用Brute F ...
- SRM 223 Div II Level Two: BlackAndRed,O(N)复杂度
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3457&rd=5869 解答分析:http://comm ...
- SRM 207 Div II Level Two: RegularSeason,字符串操作(sstream),多关键字排序(操作符重载)
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=2866&rd=5853 主要是要对字符串的操作要熟悉,熟 ...
- SRM 577 Div II Level Two: EllysRoomAssignmentsDiv2
题目来源: http://community.topcoder.com/tc?module=ProblemDetail&rd=15497&pm=12521 这个问题要注意的就是只需要直 ...
- SRM 582 Div II Level One: SemiPerfectSquare
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12580 比较简单,代码如下: #include <ios ...
- SRM 582 Div II Level Two SpaceWarDiv2
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12556 #include <iostream> # ...
- SRM 582 Div II Level Three: ColorTheCells, Brute Force 算法
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12581 Burte Force 算法,求解了所有了情况,注意 ...
- SRM 583 Div II Level One:SwappingDigits
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12609 #include <iostream> # ...
随机推荐
- 《转载》常用算法经典代码(C++版)
转自:http://blog.renren.com/blog/311453043/736944237 一.快速排序 void qsort(int x,int y) //待排序的数据存放在a[1]..a ...
- 指尖上的电商---(3)Solr全文搜索引擎的配置
接上篇,Solr的准备工作完毕后,本节主要介绍Solr的安装,事实上Solr不须要安装.直接下载就能够了 1.Solr配置 下载地址 :http://lucene.apache.org/so ...
- VS2008 环境中完美搭建 Qt 4.7.4 静态编译的调试与发布(好像很不错,有六张插图说明)good
为什么要在VS2008中使用QT静态编译呢?很简单,因为VS2008编译器编译出来的文件比mingw编译的要几乎小一半. 好了现在我们来做些准备工作,VS2008自然要安装的,然后打上SP1的补丁.然 ...
- 14.4.3.2 Configuring Multiple Buffer Pool Instances 配置多个buffer pool 实例:
14.4.3.2 Configuring Multiple Buffer Pool Instances 配置多个buffer pool 实例: 对于系统 buffer pool 有多个G的范围, 把b ...
- Android Fragment的介绍与使用(案例Demo)
应用场景: 众所了解Android上的界面展示都是通过Activity实现的,可是Activity也有它的局限性,相同的界面在手机上显示可能非常好看,在平板上就未必了.为了让界面能够在平板上更好地展示 ...
- 各种oracle10g下载地址(官网网页上好像找不到了)
Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit ...
- 属性“dataProvider”有多个初始值设定项。(注意:“dataProvider”是“mx.charts.BarChart”的默认属性)。
1.错误描写叙述 属性"dataProvider"有多个初始值设定项.(注意:"dataProvider"是"mx.charts.BarChart&q ...
- 基于Andoird 4.2.2的Account Manager源代码分析学习:创建选定类型的系统帐号
AccountManager.addAccount() public AccountManagerFuture<Bundle> addAccount(final String accoun ...
- C# Dictionary.Add(key,value) 与 Dictionary[key]=value的区别
1. MSDN上的描述. http://msdn.microsoft.com/zh-cn/library/9tee9ht2(v=VS.85).aspx 通过设置 Dictionary 中不存在的键值, ...
- 金融界高富帥現身快男北京唱區 陳樂:我拿生活養夢想__娛樂新聞_Yes娛樂
http://m.baidu.com/tc?pn=15&bd_page_type=1&pu=sz%401320%5F1001%2Cta%40iphone%5F2%5F4%2E1%5F3 ...