随笔分类 - 数学
摘要:"题目链接" 题目大意: 给一个长度为$n$的数组,找出数组中出现次数大于$\left \lfloor n/3 \right \rfloor$的所有元素。 思路: 本题做法基于一个事实:每次选三个不同的数,从数组中删除,不断重复。该步骤最多只能执行$\left \lfloor n/3 \right
阅读全文
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=648&page=show_problem&problem=5150题目大意:给一幅N个点M条边的无向图,有一些边,其...
阅读全文
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=648&page=show_problem&problem=5155There are N guests checki...
阅读全文
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=648&page=show_problem&problem=5159In normal football games,...
阅读全文
摘要:题目链接:http://hihocoder.com/contest/msbop2015qual/problemsA.2月29日首先为了方便处理可以分类一下把问题转化成第a年到第b年的闰年数量。然后如果要求fun(x)=1~x年中闰年的数量,容斥一下就是 (1~x中4的倍数) -(1~x中100的倍数...
阅读全文
摘要:Problem DescriptionAfter eating food from Chernobyl, DRD got a super power: he could clone himself right now! He used this power for several times. He...
阅读全文
摘要:OI/ACM中经常要用到小数来解决问题(概率、计算几何等),但是小数在计算机中的存储方式是浮点数而不是我们在作数学运算中的数,有精度的限制。 以下以GUN C++为准,其他语言(或编译器)也差不了多少。本文竞赛向。一、基础篇1、一般浮点数使用double,范围为大概为-10^308 ~ 10^...
阅读全文
摘要:Problem DescriptionMath is important!! Many students failed in 2+2’s mathematical test, so let's AC this problem to mourn for our lost youth..Look thi...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4816Problem DescriptionThe Bathysphere is a spherical deep-sea submersible which was unpowered and lowe...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4900Problem DescriptionThere is an old country and the king fell in love with a devil. The devil always...
阅读全文
摘要:In mathematical terms, the sequenceFnof Fibonacci numbers is defined by the recurrence relationF1 = 1;F2 = 1;Fn = Fn - 1 + Fn - 2(n > 2).DZY loves Fib...
阅读全文
摘要:Problem DescriptionCalculate A * B.InputEach line will contain two integers A and B. Process to end of file.Note: the length of each integer will not ...
阅读全文
摘要:Problem Description一个{1, ..., n}的子集S被称为JZP集,当且仅当对于任意S中的两个数x,y,若(x+y)/2为整数,那么(x+y)/2也属于S。例如,n=3,S={1,3}不是JZP集,因为(1+3)/2=2不属于S。但是{1,2,3}的其他子集都属于S,所以n=3时...
阅读全文
摘要:Problem Description 小度和小良最近又迷上了下棋。棋盘一共有N行M列,我们可以把左上角的格子定为(1,1),右下角的格子定为(N,M)。在他们的规则中,“王”在棋盘上的走法遵循十字路线。也就是说,如果“王”当前在(x,y)点,小度在下一步可以移动到(x+1, y), (x-1, ...
阅读全文
摘要:DescriptionProf. Kaykobad has given Nasa the duty of buying some food for the ACM contestents. Nasa decided to buyndifferent items. He then asked each of themcontestents how much of each item they want to eat. They could not give any logical answer, they only want as much as they wish! Nasa knows qu
阅读全文
摘要:DescriptionThe widget factory produces several different kinds of widgets. Each widget is carefully built by a skilled widgeteer. The time required to build a widget depends on its type: the simple widgets need only 3 days, but the most complex ones may need as many as 9 days.The factory is currentl
阅读全文
摘要:Shirai Kurokois a Senior One student. Almost everyone inAcademy Cityhave super powers, andKurokois good at using it. Her ability is "Teleporting", which can make people to transfer in the eleven dimension, and it shows like moving instantly in general people's eyes.In fact, the theory
阅读全文
摘要:Problem DescriptionDuring a programming contest, teams cannot sit close to each other, because then a team might copy the solution of another team. You are given the locations of the teams and the minimum required Euclidian distance between two teams. You have to find the number of pairs of teams th
阅读全文
摘要:Our chemical biologists have invented a new very useful form of life calledstripies(in fact, they were first called in Russian -polosatiki, but the scientists had to invent an English name to apply for an international patent). The stripies are transparent amorphous amebiform creatures that live in
阅读全文
摘要:A centipede has 40 left feet and 40 right feet. It keepsaleft slippers andbright slippers under its bed. Every morning the centipede puts on the slippers. It pokes its first left foot under the bed and puts on a random slipper, doing it in one second. If the slipper is left, the centipede passes to
阅读全文

浙公网安备 33010602011771号