高精度水题(POJ2109)】的更多相关文章

题目链接:http://poj.org/problem?id=2109 double 可以虽然可以表示10^-307~~~10^208,但是精确度只有16位,这个题有bug. #include <stdio.h> #include <cmath> using namespace std; int main() { double n,p; while(scanf("%lf%lf",&n,&p)!=EOF) { printf("%.0f\n…
输入的前六位数表示一个小数,然后输入一个数表示几次方.要求用高精度算出结果. 高精度水题,主要注意处理小数点,先在输入时把小数点提取出来并记录位置,用普通乘法计算出结果后由后向前计算位置添加小数点. 代码: #include <cstdio> #include <cstring> const int maxn = 300; void Mul(char *str1, char *str2, char *str3){ int i, j, i1, i2, tmp, carry, jj;…
转载请注明出处:優YoU http://blog.csdn.net/lyy289065406/article/details/6642573 部分解题报告添加新内容,除了原有的"大致题意"和"解题思路"外, 新增"Source修正",因为原Source较模糊,这是为了帮助某些狂WA的同学找到测试数据库,但是我不希望大家利用测试数据打表刷题 ­­ ­ 推荐文:1.一位ACMer过来人的心得 2. POJ测试数据合集 OJ上的一些水题(可用来练手和增…
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
11.9 线段树 http://acm.hdu.edu.cn/showproblem.php?pid=6315 求逆序对个数 http://acm.hdu.edu.cn/showproblem.php?pid=6318 必赢博弈 http://acm.hdu.edu.cn/showproblem.php?pid=6312 欧拉回路 http://acm.hdu.edu.cn/showproblem.php?pid=6311 好难的构造题目 http://acm.hdu.edu.cn/showpr…
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3049    Accepted Submission(s): 2364 Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of…
CSU 1772 漫漫上学路 Time Limit: 1000MS   Memory Limit: 131072KB   64bit IO Format: %lld & %llu Submit Status Description 对于csuxushu来说,能够在CSU(California State University)上学是他一生的荣幸.CSU校园内的道路设计的十分精巧,由n+1条水平道路和n+1条竖直道路等距交错而成,充分体现了校园深厚的文化底蕴.然而不幸的是CS市每到夏季,天降大雨,…
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 112[Submit][Status][Web Board] Description 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换. Input 一个3x3的矩阵 Output 转置后的矩阵 Sample Input 1 2 3 4 5 6 7 8 9 Sample Output 1 4 7…
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Write a program to find and print…
1195: 相信我这是水题 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 821  Solved: 219 Description GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,萌萌的师弟师妹们们经常会让pigofzhou帮他们Debug,因为师弟师妹们打代码使用编程语言的种类千奇百怪,pigofzhou为此很头疼.现在假设师弟师妹们只喜欢Java或者C++或者C,因为他希望所有人都学相同的编程语言,只有这样pigofzhou教…
1303: [CQOI2009]中位数图 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 2340  Solved: 1464[Submit][Status][Discuss] Description 给出1~n的一个排列,统计该排列有多少个长度为奇数的连续子序列的中位数是b.中位数是指把所有元素从小到大排列后,位于中间的数. Input 第一行为两个正整数n和b ,第二行为1~n 的排列. Output 输出一个整数,即中位数为b的连续子序列个数.…
B - 大还是小? Time Limit:5000MS     Memory Limit:65535KB     64bit IO Format: Description 输入两个实数,判断第一个数大,第二个数大还是一样大.每个数的格式为: [整数部分].[小数部分] 简单起见,整数部分和小数部分都保证非空,且整数部分不会有前导 0.不过,小数部分的最 后可以有 0,因此 0.0 和 0.000 是一样大的. Input 输入包含不超过 20 组数据.每组数据包含一行,有两个实数(格式如前所述)…
ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: 1001  Sum Problem 相加1002  A + B Problem II 模拟人工加法-精度计算 1008 Elevator 很水,但是情况要考虑全面…
Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n games in a football tournament. Three…
Codeforces Round #258 (Div. 2) Sort the Array B. Sort the Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Being a programmer, you like arrays a lot. For your birthday, your friends ha…
Codeforces Round #258 (Div. 2) Game With Sticks A. Game With Sticks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output After winning gold and silver in IOI 2014, Akshat and Malvika want to hav…
题意就是讲给出的字符串元音字母去掉,在每个辅音字母前加点,且小写输出...注意y也要去掉(以我英语挂科的水平也知道y是辅音字母)... 水题.. 直接上代码好了... #include <iostream> #include <stdio.h> #include <string.h> #define MAXN 100+10 using namespace std; char s[]={"aeiouAEIOUyY"}; int main(void) {…
1061: 从三个数中找出最大的数 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 124[Submit][Status][Web Board] Description 定义一个带参的宏(或者模板函数),从三个数中找出最大的数. Input 3个短整型数,空格隔开 3个实数,空格隔开 3个长整数,空格隔开 Output 最大的数,对于实数保留2位小数. Sample Input 1 2 3 1.5 4.7 3.2 12345…
1059: 判别该年份是否闰年 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 222  Solved: 139[Submit][Status][Web Board] Description 给年份year,定义一个宏,以判别该年份是否闰年.提示:宏名可以定义为LEAP_YEAR,形参为y,既定义宏的形式为 #define LEAP_YEAR(y) (读者设计的字符串) Input 一个年份 Output 根据是否闰年输出,是输出"L",否…
1064: 输入三个字符串,按由小到大的顺序输出 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 471  Solved: 188[Submit][Status][Web Board] Description 输入三个字符串,按由小到大的顺序输出.分别使用指针和引用方式实现两个排序函数.在主函数中输入和输出数据. Input 3行字符串 Output 按照从小到大输出成3行.由指针方式实现. 按照从小到大输出成3行.由引用方式实现.   Sample…
LSS Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 128000/64000 KB (Java/Others) SubmitStatistic Next Problem Problem Description Time flies, four years passed, colleage is over. When I am about to leave, a xuemei ask me an ACM  problem, but…
DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 80832   Accepted: 32533 Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instanc…
Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical,…
487-3279 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 236746   Accepted: 41288 Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phras…
Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 126087   Accepted: 55836 Description Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has deci…
Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 99450   Accepted: 48213 Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're as…
2558: 游起来吧!超妹! Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 7  Solved: 3[Submit][Status][Web Board] Description 夏天到了,无聊的超妹跑到了落雪湖里抓鱼吃.结果,游到湖的正中 央时被湖边保安看到了,保安要抓住超妹.我们假设落雪湖是一个半径为r的圆形,超妹在圆形的正中心,速度为1.保安由于不会游泳所以只能沿着湖的边缘奔 跑,速度为n.因为超妹在陆地上的速度是很快的,所以我们假设只要超妹…
I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 85149   Accepted: 36857 Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land,…
Higher Math Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2219    Accepted Submission(s): 1219 Problem Description You are building a house. You’d prefer if all the walls have a precise right…
算法训练 Torry的困惑(基本型) 时间限制:1.0s   内存限制:512.0MB      问题描述 Torry从小喜爱数学.一天,老师告诉他,像2.3.5.7……这样的数叫做质数.Torry突然想到一个问题,前10.100.1000.10000……个质数的乘积是多少呢?他把这个问题告诉老师.老师愣住了,一时回答不出来.于是Torry求助于会编程的你,请你算出前n个质数的乘积.不过,考虑到你才接触编程不久,Torry只要你算出这个数模上50000的值. 输入格式 仅包含一个正整数n,其中n…