
简单数学
so_so_y
start to record bugs <- so hard so brave
展开
-
POJ 3103 Astronomy
DescriptionThere are n planets in the planetary system of star X. They orbit star X in circular orbits located in the same plane. Their tangent velocities are constant. Directions of orbiting of all pl原创 2017-04-24 19:08:19 · 699 阅读 · 0 评论 -
hihocoder第158周非法二进制数(dp)
描述如果一个二进制数包含连续的两个1,我们就称这个二进制数是非法的。小Hi想知道在所有 n 位二进制数(一共有2n个)中,非法二进制数有多少个。例如对于 n = 3,有 011, 110, 111 三个非法二进制数。由于结果可能很大,你只需要输出模109+7的余数。输入一个整数 n (1 ≤ n ≤ 100)。输出n 位非法二进制数的数目模109+7的余原创 2017-07-10 19:04:55 · 651 阅读 · 0 评论 -
第一届ACM金牌训练营网络测试赛 C. Math(简单数学)
Description对于一个数对 (a,b),如果满足 a%b=a/b,则称这个数对为“好的数对”。如果 a≤n,b≤n" role="presentation" style="position: relative;">a≤n,b≤na≤n,b≤na\le n,b\le n, 那么有多少对数对是“好的数对”呢?Input多组数据。 每组数据一行,一个数表原创 2018-01-25 11:14:26 · 636 阅读 · 0 评论 -
codeforces 621 D. Rat Kwesh and Cheese(log处理)
DescriptionWet Shark asked Rat Kwesh to generate three positive real numbers x, y and z, from 0.1 to 200.0, inclusive. Wet Krash wants to impress Wet Shark, so all generated numbers will have exactl...原创 2018-02-27 17:44:03 · 285 阅读 · 0 评论 -
CodeForces 712C Memory and De-Evolution(贪心+数学)
DescriptionMemory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an ...原创 2018-03-19 20:38:24 · 184 阅读 · 0 评论 -
CodeForces 716C Plus and Square Root(规律)
DescriptionZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ’ + ’ (plus) and ” (square root). Initially, the number 2 is displayed on the screen. ...原创 2018-03-19 20:51:53 · 256 阅读 · 0 评论 -
CodeForces 959 E Mahmoud and Ehab and the xor-MST(异或 思维)
DescriptionEhab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consisting of n vertices numbered from 0 to ...原创 2018-04-11 21:55:54 · 227 阅读 · 0 评论 -
51nod 1185 威佐夫游戏 V2
题目描述有2堆石子。A B两个人轮流拿,A先拿。每次可以从一堆中取任意个或从2堆中取相同数量的石子,但不可不取。拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出2堆石子的数量,问最后谁能赢得比赛。 例如:2堆石子分别为3颗和5颗。那么不论A怎样拿,B都有对应的方法拿到最后1颗。Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 <...原创 2018-04-05 14:04:08 · 129 阅读 · 0 评论 -
山东省第八届ACM省赛 quadratic equation(简单数学)
Problem DescriptionWith given integers a,b,c, you are asked to judge whether the following statement is true: “For any x, if a⋅x2+b⋅x+c=0a⋅x2+b⋅x+c=0a⋅x^2+b⋅x+c=0, then x is an integer.”InputT...原创 2018-04-24 17:21:03 · 276 阅读 · 0 评论 -
山东省第六届ACM省赛 Square Number(数学+思维)
Problem DescriptionIn mathematics, a square number is an integer that is the square of an integer. In other words, it is the product of some integer with itself. For example, 9 is a square number, s...原创 2018-04-27 10:09:57 · 364 阅读 · 0 评论 -
ACM中的浮点数精度处理
原文链接 在ACM中,精度问题非常常见。其中计算几何头疼的地方一般在于代码量大和精度问题,代码量问题只要平时注意积累模板一般就不成问题了。精度问题则不好说,有时候一个精度问题就可能成为一道题的瓶颈,让你debug半天都找不到错误出在哪。1.浮点数为啥会有精度问题:浮点数(以C/C++为准),一般用的较多的是float, double。 占字节数 数值范围转载 2018-01-24 16:02:37 · 274 阅读 · 0 评论 -
51nod 1138 连续整数的和(简单数学、等差数列)
Description给出一个正整数N,将N写为若干个连续数字和的形式(长度 >= 2)。例如N = 15,可以写为1 + 2 + 3 + 4 + 5,也可以写为4 + 5 + 6,或7 + 8。如果不能写为若干个连续整数的和,则输出No Solution。Input输入1个数N(3 <= N <= 10^9)。Output输出连续整数中的第1个数,如果有多个按照递增序排列,如果不能分解为若干个连续原创 2017-11-27 21:09:08 · 346 阅读 · 0 评论 -
HDU 6038 Function (多校1)
Problem DescriptionYou are given a permutation a from 0 to n−1 and a permutation b from 0 to m−1.Define that the domain of function f is the set of integers from 0 to n−1, and the range of it is the se原创 2017-07-28 20:20:38 · 329 阅读 · 0 评论 -
HDU 6055 Regular polygon(几何数学)(多校2)
Problem DescriptionOn a two-dimensional plane, give you n integer points. Your task is to figure out how many different regular polygon these points can make.InputThe input file consists of several tes原创 2017-07-28 09:48:28 · 699 阅读 · 0 评论 -
hihoCoder 第157周 二进制小数
描述给定一个十进制小数X,判断X的二进制表示是否是有限确定的。例如0.5的二进制表示是0.1,0.75的二进制表示是0.11,0.3没有确定有限的二进制表示。输入第一行包含一个整数 T (1 ≤ T ≤ 10),表示测试数据的组数。以下T行每行包含一个十进制小数 X (0 < X < 1)。 X一定是以"0."开头,小数部分不超过100位。输出对于每组输入,输出 X 的二进制表示或者NO(如原创 2017-07-02 16:48:01 · 470 阅读 · 0 评论 -
Codeforces Round #395(Div. 2)D. Timofey and rectangles
四色问题的内容是“任何一张地图只用四种颜色就能使具有共同边界的国家着上不同的颜色。”也就是说在不引起混淆的情况下一张地图只需四种颜色来标记就行。 From-百度百科昨天遇到一个有关的问题先贴在这里,以后做到新的问题再做总结 Codeforces Round #395 (Div. 2) D. Timofey and rectangles原创 2017-02-03 22:42:44 · 441 阅读 · 0 评论 -
HDU 6058 Kanade's sum(多校3)
Problem DescriptionGive you an array A[1..n]of length n. Let f(l,r,k) be the k-th largest element of A[l..r].Specially , f(l,r,k)=0 if r−l+1InputThere is only one integer T on first line.For each test原创 2017-08-06 20:57:44 · 242 阅读 · 0 评论 -
HDU 6069 Counting Divisors(多校4)
Problem DescriptionIn mathematics, the function d(n) denotes the number of divisors of positive integer n.For example, d(12)=6 because 1,2,3,4,6,12 are all 12’s divisors.In this problem, given l,r and原创 2017-08-07 12:27:29 · 431 阅读 · 0 评论 -
HDU 6158 The Designer(笛卡尔定理+韦达定理)
Problem DescriptionNowadays, little haha got a problem from his teacher.His teacher wants to design a big logo for the campus with some circles tangent with each other. And now, here comes the problem.原创 2017-08-21 21:29:59 · 2593 阅读 · 0 评论 -
ZOJ 3993 Safest Buildings(概率 数学)
DescriptionPUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding ge原创 2017-11-03 21:59:31 · 476 阅读 · 0 评论 -
51nod 1350 斐波那契表示(打表+找规律)
Description每一个正整数都可以表示为若干个斐波那契数的和,一个整数可能存在多种不同的表示方法,例如:14 = 13 + 1 = 8 + 5 + 1,其中13 + 1是最短的表示(只用了2个斐波那契数)。定义F(n) = n的最短表示中的数字个数,F(14) = 2,F(100) = 3(100 = 3 + 8 + 89),F(16) = 2(16 = 8 + 8 = 13 + 3)。定义G原创 2017-11-15 21:00:28 · 279 阅读 · 0 评论 -
山东省第六届ACM省赛 Cube Number(数学+思维)
Problem DescriptionIn mathematics, a cube number is an integer that is the cube of an integer. In other words, it is the product of some integer with itself twice. For example, 27 is a cube number, ...原创 2018-04-27 20:22:05 · 455 阅读 · 0 评论