POJ-2006 Litmus Test 高精度】的更多相关文章

Litmus Test Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 1709   Accepted: 897 Description The pH scale measures the concentration of protons (H+) in a solution and, therefore, its acidity or alkalinity. The pH value of a solution is a…
题目链接:http://poj.org/problem?id=1503 思路分析: 基本的高精度问题,使用字符数组存储然后处理即可. 代码如下: #include <iostream> #include <string> using namespace std; + ; char input[M]; int A[M], sum[M]; void Reverse(int A[], const char str[]) { int len = strlen(str); ; ; i >…
POJ 2084 /**************************************** * author : Grant Yuan * time : 2014/10/19 15:42 * source : POJ 2084 * algorithm: Catalan数+高精度 * ***************************************/ import java.io.*; import java.math.*; import java.util.*; publ…
题目链接:http://poj.org/problem?id=2006 解题报告: 题意看了半天,没看懂,再加上化学没学好,更加让我头痛. 假设1L溶解了x摩尔的酸:ka=m*x*nx/ori-x; 得:mnx*x+kax-ka*ori=0; 解方程x=(sqrt(k*k*a*a+4mnka*ori)-ka)/2mn; 溶度为x*m; PH=log10(x*m); 这里log是e为底的,应该用log((double)10) #include<stdio.h> #include<math.…
题目是POJ1001 Exponentiation  虽然是小数的幂 最终还是转化为大整数的乘法 这道题要考虑的边界情况比较多 做这道题的时候,我分析了 网上的两个解题报告,发现都有错误,说明OJ对于错误的判断还不够严厉. 对边界情况的讨论其实应该是思维严密的表现,当然这并不能表明我写的一点错误都没有,只是多多分析一下还是很有好处的. #include <iostream> #include <fstream> #include <string> #include &l…
BUPT2017 wintertraining(15) #6A 题意 求\(R^n\) ( 0.0 < R < 99.999 )(0 < n <= 25) 题解 将R用字符串读进来,找到小数点的位置,然后转为整数. 用高精度乘法和快速幂计算.输出时要确定一下小数点的位置. 代码 #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> u…
The pH scale measures the concentration of protons (H +) in a solution and, therefore, its acidity or alkalinity. The pH value of a solution is a number between 0 and 14; it is less than 7 if the solution is acidic, greater than 7 if the solution is…
Censored! Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 6956   Accepted: 1887 Description The alphabet of Freeland consists of exactly N letters. Each sentence of Freeland language (also known as Freish) consists of exactly M letters w…
题目链接:http://poj.org/problem?id=3181 题目大意:用1,2...K元的硬币,凑成N元的方案数. Sample Input 5 3 Sample Output 5 分析:这不是母函数是什么,不管你信不信,反正我是信了. 之前有过一篇,讲母函数的动态规划做法http://www.cnblogs.com/acm-bingzi/archive/2013/04/30/3051725.html 这道题目,坑就坑在高精度上了,刚开始怎么也没想到,而且做法也很奇特.就是将2个lo…
Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 11161   Accepted: 3893 Description Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9...are all relative…