ZOJ 1242 Carbon Dating
UVA昨天上不去,今天一大早起来还是上不去 0.0
于是去ZOJ
这题大意就是半衰期。。。
取对数用到了换底公式。。。我都忘了这玩意了T T
上代码。。。
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main()
- {
- double w ,d,n;
- int count=1;
- while(cin>>w>>d,w||d)
- {
- d/=w;
- n=5730*log(d/810)/log(0.5);
- if(n<10000)
- n=int (n+50)/100*100;
- else
- n=int (n+500)/1000*1000;
- cout<<"Sample #"<<count++<<endl<<"The approximate age is "<<n<<" years."<<endl<<endl;
- }
- return 0;
- }
ZOJ 1242 Carbon Dating的更多相关文章
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- http 登录Digest认证相关知识
Digest access authentication https://en.wikipedia.org/wiki/Digest_access_authentication Digest acces ...
- HDU 1242 Rescue(BFS),ZOJ 1649
题目链接 ZOJ链接 Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The ...
- ZOJ题目分类
ZOJ题目分类初学者题: 1001 1037 1048 1049 1051 1067 1115 1151 1201 1205 1216 1240 1241 1242 1251 1292 1331 13 ...
- ZOJ 1015 弦图判定
一些定义: 弦图是一种特殊图:它的所有极小环都只有3个顶点. 单纯点:该顶点与其邻接点在原图中的导出子图是一个完全图. 图G的完美消去序列:一个顶点序列a1a2a3...an,使得对于每个元素ai,a ...
- ZOJ-1649 Rescue BFS (HDU 1242)
看题传送门: ZOJ http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1649 HDU http://acm.hdu.edu. ...
- ZOJ People Counting
第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ 3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=394 ...
- ZOJ 3686 A Simple Tree Problem
A Simple Tree Problem Time Limit: 3 Seconds Memory Limit: 65536 KB Given a rooted tree, each no ...
随机推荐
- Linux学习总结(8)——VMware v12.1.1 专业版以及永久密钥
VMware v12.1.1 专业版以及永久密钥 热门虚拟机软件VMware Workstation 现已更新至v12.1.1 专业版!12.0属于大型更新,专门为Win10的安装和使用做了优化,支持 ...
- android与C# WebService基于ksoap通信(C#篇)
1.打开VS 2013新建项目>>ASP.NET空WEB应用程序(我用的是.net 4.0) 2.在刚建立的项目上加入新建项(WebService) 这时TestService的代码例如以 ...
- Linux下使用fstatfs/statfs查询系统相关信息
Linux下使用fstatfs/statfs查询系统相关信息 1. 功能 #include < sys/statfs.h > int statfs(const char *path, ...
- HDU 5375 Gray code(DP)
题意:给一串字符串,里面可能出现0,1,?,当中问号可能为0或1,将这个二进制转换为格雷码后,格雷码的每位有一个权值,当格雷码位取1时.加上该位权值,求最大权值和为多少. 分析:比赛的时候愚了.竟然以 ...
- jquery19 ajax()
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...
- javafx style and cssFile
public class EffectTest extends Application { public static void main(String[] args) { launch(args); ...
- logrotate---日志分割
logrotate命令用于对系统日志进行轮转.压缩和删除,也可以将日志发送到指定邮箱.使用logrotate指令,可让你轻松管理系统所产生的记录文件.每个记录文件都可被设置成每日,每周或每月处理,也能 ...
- [Javascript] Classify JSON text data with machine learning in Natural
In this lesson, we will learn how to train a Naive Bayes classifier and a Logistic Regression classi ...
- oracle on linux 巡检脚本-部分
#!/bin/sh #ocpyang@126.com #Modified according to the actual situation mysql server IP and username ...
- Day5上午解题报告
预计分数:100+40+30=170 实际假分数:0+0+0=0 CE*3 实际真分数:60+50+0=110 老师没把我的程序放的文件夹里面,于是..... T1 https://www.luogu ...