Math
文章平均质量分 74
bingsanchun
这个作者很懒,什么都没留下…
展开
-
省赛热身赛之_Taxi Fare
原题:DescriptionLast September, Hangzhou raised the taxi fares.The original flag-down fare in Hangzhou was 10 yuan, plusing 2 yuan per kilometer after the first 3km and 3 yuan per kilometer原创 2013-04-25 18:44:46 · 1246 阅读 · 0 评论 -
FZU——上车
Problem Description有N个人排成一队按顺序上车,座位在前排并且排在队伍前面的人上车后会对座位在后面并且排他在后面的人造成阻碍。现给出每个人坐在第几排,假设这辆车有100排,每一排有100个座位。定义每个人的上车困难度为比这个人先上车并且座位在其前排的人数。问N个人的上车困难度之和。 Input第一行一个整数T(T每组数据先输入一行一个整数N(1原创 2013-11-10 17:03:13 · 1214 阅读 · 0 评论 -
zju——涨价了
题目描述小明所在的城市的出租车价又涨了。涨价之前,出租车的起步价为10元,可行驶3到公里。3公里后,每公里加2元,可行驶到10公里。10公里后,每公里加3元。等待费是每5分钟2元。乘客还需付1元的燃油费。涨价之后,出租车的起步价为11元,可行驶3到公里。3公里后,每公里加2.5元,可行驶到10公里。10公里后,每公里加3.75元。等待费是每4分钟2.5元。无燃油费。实际上,最后原创 2013-11-09 22:44:58 · 1731 阅读 · 0 评论 -
SGU135——Drawing Lines(math)
Little Johnny likes to draw a lot. A few days ago he painted lots of straight lines on his sheet of paper. Then he counted in how many zones the sheet of paper was split by these lines. He noticed tha原创 2013-11-21 14:53:52 · 1618 阅读 · 0 评论 -
SGU107——987654321 problem
For given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321. InputInput contains integer number N (16) OutputWrite answer原创 2013-11-21 11:31:05 · 2077 阅读 · 0 评论 -
SGU102——Coprimes (又见欧几里得)
102. Coprimes time limit per test: 0.5 sec. memory limit per test: 4096 KB For given integer N (1N104) find amount of positive numbers not greater than N that coprime with N. Let us call tw原创 2013-11-19 16:08:06 · 1441 阅读 · 0 评论 -
最小公倍数和最大公约数
原题:题目描述从键盘输入两个正整数,求这两个正整数的最小公倍数和最大公约数,并输出。输入输入包括一行。 两个以空格分开的正整数。输出两个整数的最小公倍数和最大公约数。示例输入6 8示例输出24 2 分析:辗转相处法——————————记住源码:#incint main(){ int a,b,m,n,t;原创 2013-01-29 11:37:18 · 638 阅读 · 0 评论 -
SGU105—— Div 3
105. Div 3 time limit per test: 0.5 sec. memory limit per test: 4096 KB There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determin原创 2013-11-19 16:55:49 · 1335 阅读 · 0 评论 -
UVA11384-Help is needed for Dexter
Dexter is tired of Dee Dee. So he decided to keep Dee Dee busy in a game. The game he planned for her is quite easy to play but not easy to win at least not for Dee Dee. But Dexter does not have time原创 2013-11-04 20:00:10 · 1342 阅读 · 0 评论 -
HDU1061-Rightmost Digit(快速幂取模)
看到这道题,水神看到笑了;规律弟看了笑了;数学帝看到笑了; 快速幂版本:原创 2013-11-28 20:05:06 · 1524 阅读 · 0 评论 -
SGU231-Prime Sum 还是素数
231. Prime Sum time limit per test: 0.5 sec.memory limit per test: 4096 KBinput: standardoutput: standardFind all pairs of prime numbers (A, B) such that A<=B and their sum is also a原创 2013-12-05 22:48:40 · 9671 阅读 · 0 评论 -
SGU113—— Nearly prime numbers
Nearly prime number is an integer positive number for which it is possible to find such primesP1 and P2 that given number is equal to P1*P2. There is given a sequence on N integer positive numbers原创 2013-11-22 22:02:02 · 1913 阅读 · 0 评论 -
SGU114-Telecasting station
114. Telecasting station time limit per test: 0.5 sec. memory limit per test: 4096 KB Every city in Berland is situated on Ox axis. The government of the country decided to build new telecas原创 2013-12-04 21:15:40 · 9470 阅读 · 0 评论 -
SGU130-circle
130. Circle time limit per test: 0.5 sec. memory limit per test: 4096 KB On a circle border there are 2k different points A1, A2, ..., A2k, located contiguously. These points connect k chord原创 2013-12-04 00:28:31 · 9683 阅读 · 0 评论 -
SGU154——Factorial (poj1401变形题——数论+二分)
154. Factorial time limit per test: 0.5 sec.memory limit per test: 4096 KBinput: standard inputoutput: standard outputYou task is to find minimal natural number N, so that N! contain原创 2013-12-03 18:33:31 · 10197 阅读 · 0 评论 -
POJ1401-Factorial
DescriptionThe most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cells (this term gave the name to the cellular phone) and ev原创 2013-12-03 17:09:49 · 9841 阅读 · 0 评论 -
SGU118——Digital Root
118. Digital Root time limit per test: 0.5 sec. memory limit per test: 4096 KB Let f(n) be a sum of digits for positive integer n. If f(n) is one-digit number then it is a digital root for原创 2013-12-02 21:24:15 · 1381 阅读 · 0 评论 -
SGU144-Meeting(几何概型)
144. Meeting time limit per test: 0.5 sec. memory limit per test: 4096 KB Two of the three members of the winning team of one of the ACM regional contests are going to meet in order to train原创 2013-12-07 10:24:39 · 9612 阅读 · 0 评论 -
hdu2005——第几天?
原题: Problem Description 给定一个日期,输出这个日期是该年的第几天。 Input 输入数据有多组,每组占一行,数据格式为YYYY/MM/DD组成,具体参见sample input ,另外,可以向你确保所有的输入数据是合法的。 Output原创 2013-02-22 16:45:36 · 433 阅读 · 0 评论 -
hdu2388——Lowest Common Multiple Plus
原题:Problem Description求n个数的最小公倍数。 Input输入包含多个测试实例,每个测试实例的开始是一个正整数n,然后是n个正整数。 Output为每组测试数据输出它们的最小公倍数,每个测试实例的输出占一行。你可以假设最后的输出是一个32位的整数。 Sample Input2 4 63 2 5 7原创 2013-03-27 10:14:41 · 677 阅读 · 0 评论 -
uva100—— The 3n + 1 problem
原题:BackgroundProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of原创 2013-05-29 18:59:45 · 2274 阅读 · 2 评论 -
Compression
原题:Description Let Compression of an integer a be the sum of all digits of a and yields another positive integer. It is obvious that if we compress a number for certain finite steps, we will原创 2013-05-14 18:58:47 · 674 阅读 · 0 评论 -
poj2388——Who's in the Middle
原题:DescriptionFJ is surveying his herd to find the most average cow. He wants to know how much milk this 'median' cow gives: half of the cows give as much or more than the median; half give as mu原创 2013-05-07 19:42:31 · 524 阅读 · 0 评论 -
练习赛—— A simple problem again
原题:DescriptionAlthough Dreamone has been studying in USTC for nearly one year,he is missing the mates of swust all the time.Recently Dreamone has found the equation through which he can feel be原创 2013-05-05 20:00:50 · 664 阅读 · 0 评论 -
poj1005——I Think I Need a Houseboat
原题:DescriptionFred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrin原创 2013-05-03 21:37:22 · 1054 阅读 · 0 评论 -
poj2017——Speed Limit
原题:DescriptionBill and Ted are taking a road trip. But the odometer in their car is broken, so they don't know how many miles they have driven. Fortunately, Bill has a working stopwatch, so they c原创 2013-05-03 19:33:13 · 666 阅读 · 0 评论 -
省AK赛——J - Happy Great BG
原题:DescriptionThe summer training of ZJU ICPC in July is about to end. To celebrate this great and happy day, the coaches of ZJU ICPC TeamNavi andFancy decided to BG everyone! Beside the two原创 2013-04-18 19:16:29 · 850 阅读 · 0 评论 -
省赛AK练习赛之Pizza Cutting
原题:Description Problem EPizza CuttingInput:standard inputOutput: standard output When someone calls Ivan lazy, he claims that it is his intelligence that helps him to be so.原创 2013-04-01 20:17:38 · 1067 阅读 · 0 评论 -
两道相似题——water-easy&&Javabeans
一、Javabeans原题:DescriptionJavabeans are delicious. Javaman likes to eat javabeans very much. Javaman has n boxes of javabeans. There are exactly i javabeans in thei-th box (i = 1, 2, 3,...n原创 2013-04-01 19:43:03 · 1043 阅读 · 0 评论 -
三国佚事——巴蜀之危 解题报告
题目描述话说天下大势,分久必合,合久必分。。。却道那魏蜀吴三国鼎力之时,多少英雄豪杰以热血谱写那千古之绝唱。古人诚不我欺,确是应了那句“一将功成万骨枯”。 是夜,明月高悬。诸葛丞相轻摇羽扇,一脸愁苦。原来是日前蜀国战事吃紧,丞相彻夜未眠,奋笔急书,于每个烽火台写下安排书信。可想,这战事多变,丞相运筹 帷幄,给诸多烽火台定下不同计策,却也实属不易。 谁成想这送信小厮竟投靠曹操,给诸葛丞原创 2013-01-25 17:02:33 · 785 阅读 · 0 评论 -
省赛热身赛之Light Bulb
原题:DescriptionCompared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in h原创 2013-03-22 23:03:34 · 945 阅读 · 0 评论 -
孪生素数
如果n和n+2都是素数,则称它们是孪生素数。输入m,输出两个数均不超过m的最大孪生素数。5≤m≤10000。例如m=20时答案是17、19,m=1000时答案是881、883。【分析】被1和它自身整除的、大于1的整数称为素数。由于要判断n和n+2是否是素数,所以把“判断素数”可以写成一个函数,只需调用这个函数两次就可以了。这样的“判断一个事物是否具有某一性质”的函数还有一个学术名称——谓词原创 2013-08-04 17:07:45 · 3685 阅读 · 0 评论 -
ZOJ ACM CLUB晚会
题目描述ACM CLUB的会员越来越多了,为此,ACM CLUB想为会员们准备一个晚会,晚会节目由会员们表演。消息一出,报名要表演节目的会员很多,多达N个,但是由于场地和时间有限,只能从这N个人中选M个,请问一共有多少种选择方法?输入格式数据的第一行是一个正整数T,接下来有T组数据,每组数据占一行。每组数据包含两个整数N(来报名的人数,1输出每组数据输出一个整数,每个输出占原创 2013-07-22 10:05:56 · 1515 阅读 · 3 评论 -
冒泡排序中数据交换的次数
原题:题目描述 听说过冒泡排序么?很好玩很暴力的一种排序方式,但对于小数据也是很实用的哦。今天我们不希望你用它来排序,而是希望你能算出从小到大冒泡排序的过程中一共进行了多少次数据交换。输入输入数据的第一行为一个正整数 T ,表示有 T 组测试数据。接下来T行,每行第一个整数N, 然后有N个整数,无序。0输出输出共 T 行。每行一个整数,原创 2013-01-28 11:43:13 · 1990 阅读 · 0 评论 -
吉哥系列故事——礼尚往来
原题:Problem Description 吉哥还是那个吉哥 那个江湖人称“叽叽哥”的基哥 每当节日来临,女友众多的叽叽哥总是能从全国各地的女友那里收到各种礼物。 有礼物收到当然值得高兴,但回礼确是件麻烦的事! 无论多麻烦,总不好意思收礼而不回礼,那也不是叽叽哥的风格。 现在,即爱面子又抠门的叽叽哥想出了一个绝妙的好办法:他准备将各个女友送来的礼物合原创 2013-03-30 19:30:23 · 1444 阅读 · 0 评论 -
省赛热身赛之Javabeans
原题:DescriptionJavabeans are delicious. Javaman likes to eat javabeans very much. Javaman has n boxes of javabeans. There are exactly i javabeans in thei-th box (i = 1, 2, 3,...n). Everyday原创 2013-03-25 18:06:09 · 758 阅读 · 0 评论 -
小Q系列故事——大笨钟
原题:Problem Description 饱尝情感苦恼的小Q本打算隐居一段时间,但仅仅在3月25号一天没有出现,就有很多朋友想念他,所以,他今天决定再出来一次,正式和大家做个告别。 小Q近来睡眠情况很差——晚上睡不着,早上又起不来!以前总是全勤的他这个月甚至迟到了好几次,虽然主管没说什么,但是他自己清楚此事的严重性。 爱情没有了,小Q不想再失去面包,于是他决定买个原创 2013-03-30 13:52:27 · 1055 阅读 · 7 评论 -
FZU2132 - LQX的作业(概率论)
Problem DescriptionLQX在做作业时遇到一个难题不会做,请你帮她计算一下:在N个独立地分布于0和1之间的随机变量排为非递减顺序之后,这些变量中第M个小于等于x的概率是多少? Input第一行一个整数T(T每组数据一行,依次是N M x(1 Output每组数据对应一行输出,即概率是多少,四舍五入保留4位小数。 Sample原创 2013-12-15 21:02:56 · 9686 阅读 · 0 评论