![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数学
文章平均质量分 93
Charon_HN
NLP炼丹儿
展开
-
PTA L3-012 水果忍者(上下凸包)
2010年风靡全球的“水果忍者”游戏,想必大家肯定都玩过吧?(没玩过也没关系啦~)在游戏当中,画面里会随机地弹射出一系列的水果与炸弹,玩家尽可能砍掉所有的水果而避免砍中炸弹,就可以完成游戏规定的任务。如果玩家可以一刀砍下画面当中一连串的水果,则会有额外的奖励,如图1所示图 1现在假如你是“水果忍者”游戏的玩家,你要做的一件事情就是,将画面当中的水果一刀砍下。这个问题看上去有些复杂,让我们把问...原创 2019-03-27 19:27:15 · 625 阅读 · 0 评论 -
HDU 1392 入门水题凸包问题+叉乘讲解(Grahan Scan)
Surround the TreesThere are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he must know the minimal required length of the rope. However, he does n...原创 2018-09-14 17:25:11 · 858 阅读 · 2 评论 -
POJ 2429 分解质因数
https://vjudge.net/problem/POJ-2429Given two positive integers a and b, we can easily calculate the greatest common divisor (GCD) and the least common multiple (LCM) of a and b. But what about the in...原创 2020-03-30 22:02:12 · 372 阅读 · 0 评论 -
阶乘位数 计蒜客 - A2221
题目链接蒜头君对阶乘产生了兴趣,他列出了前 1010 个正整数的阶乘以及对应位数的表:nn n!n! 位数1 1 12 2 13 6 14 24 25 120 36 720 37 5040 48 40320 59 362880 610 3628800 7对于蒜头君来说,再往后就很难计算了。他试图寻找阶乘位数的规律,但是失败了。现在请你帮他计算出第一个正整数的阶乘位数大于等...原创 2020-02-23 20:45:37 · 425 阅读 · 1 评论 -
HDU - 1999 不可摸数
s(n)是正整数n的真因子之和,即小于n且整除n的因子和.例如s(12)=1+2+3+4+6=16.如果任何数m,s(m)都不等于n,则称n为不可摸数.Input包含多组数据,首先输入T,表示有T组数据.每组数据1行给出n(2<=n<=1000)是整数。Output如果n是不可摸数,输出yes,否则输出noSample Input3258Sample Output...原创 2020-02-16 22:20:20 · 293 阅读 · 0 评论 -
2019年第二阶段我要变强个人训练赛第十八场 O 大凤号装甲空母
题目描述大凤号航空母舰很喜欢算术。它,是旧日本海军中最为先进的航空母舰。它,是旧日本海军中最为短命的航空母舰。同时,她还是最平的航空母舰(龙骧:你说啥?)如此多第一 ……一生二,二生三,三生万物 ……这也许就是大凤喜欢算术的原因吧。有一天,她看到了这样一道题:令电探发现了来自远处的鱼雷,时间不多了。输入一行由空格隔开的两个非负整数,分别是n和p。输出一行表示答案。sa...原创 2019-07-31 16:21:56 · 140 阅读 · 0 评论 -
Minimal Power of Prime HDU - 6623 2019 Multi-University Training Contest 4
Minimal Power of PrimeYou are given a positive integer n > 1. Consider all the different prime divisors of n. Each of them is included in the expansion n into prime factors in some degree. Require...原创 2019-08-01 15:12:51 · 113 阅读 · 0 评论 -
2019牛客暑期多校训练营(第四场) K题 number
题目描述300iq loves numbers who are multiple of 300.One day he got a string consisted of numbers. He wants to know how many substrings in the string are multiples of 300 when considered as decimal integ...原创 2019-07-27 21:56:55 · 356 阅读 · 0 评论 -
HDU 2451 找规律 2008哈尔滨现场赛
题目链接题目描述A luxury yacht with 100 passengers on board is sailing on the sea in the twilight. The yacht is ablaze with lights and there comes out laughers and singing from the hall where an evening pa...原创 2019-08-06 21:39:15 · 402 阅读 · 0 评论 -
2019牛客暑期多校训练营(第九场)B Quadratic equation 二次剩余(逆元)
题目链接样例输入:104 45 610 1010 2520000 1000000000 53 6220 2840 11000000000 1000000000输出:2 22 3-1 -15 510000 10000474848249 525151758352077071 647922939448762649 551237578-1 -1366417...原创 2019-08-15 21:17:18 · 244 阅读 · 0 评论 -
几何题——Piece of Cake Contest1872 - 2019年我能变强组队训练赛第十七场(UPC)
Piece of CakeAlice received a cake for her birthday! Her cake can be described by a convex polygon with n vertices. No three vertices are collinear.Alice will now choose exactly k random vertices (k...原创 2019-09-05 21:50:10 · 388 阅读 · 0 评论 -
CodeForces - 1114C n的阶乘用m进制表示末尾零的个数
Trailing Loves (or L’oeufs?)The number “zero” is called “love” (or “l’oeuf” to be precise, literally means “egg” in French), for example when denoting the zero score in a game of tennis.Aki is fond ...原创 2019-09-20 21:21:23 · 557 阅读 · 0 评论 -
2019杭电多校第二场1005 = HDU6595(逆元)
Everything Is Generated In Equal ProbabilityOne day, Y_UME got an integer N and an interesting program which is shown below:Y_UME wants to play with this program. Firstly, he randomly generates an ...原创 2019-07-26 12:00:12 · 272 阅读 · 0 评论 -
ZOJ 4123
Happy Equation题意:给出的那个等式,问有多少个x满足等式,就酱;参考了几篇博客:https://blog.csdn.net/v5zsq/article/details/79325038(感觉这个比较好理解)https://www.cnblogs.com/albert-biu/p/10864882.html?tdsourcetag=s_pcqq_aiomsg打表发现当a为...原创 2019-05-18 08:58:23 · 353 阅读 · 0 评论 -
UVA11806 容斥定理
UVA11806【拉拉队】Cheerleaders.题意描述本题大致意思是讲:给定一个广场,把它分为M行N列的正方形小框。现在给定有K个拉拉队员,每一个拉拉队员需要站在小框内进行表演。但是表演过程中有如下要求:(1)每一个小框只能站立一个拉拉队员;(2)广场的第一行,最后一行,第一列,最后一列都至少站有一个拉拉队员;(3)站在广场的四个角落的拉拉队员可以认为是同时占据了一行和一...原创 2018-11-05 19:14:23 · 292 阅读 · 0 评论 -
Uvalive 3516 区间DP
题目链接:https://cn.vjudge.net/problem/UVA-1362题意:给定一个全为大写字母的序列,(一个大写字母代表树的一个结点),求出有多少颗不同的树满足前序遍历的序列恰好为所给的序列? 在白书上讲解了一种方法,用递归来实现的,设S为所输入的序列,然后dp[i][j](代表序列i到j的种数),为子序列Si,S(i+1),……Sj,对应的树的个数,特别的当i==j...原创 2018-11-05 22:10:18 · 111 阅读 · 0 评论 -
UVA 10943 How do you add 组合数学之隔板法 OR DP
Larry is very bad at math — he usually uses a calculator, whichworked well throughout college. Unforunately, he is now struck ina deserted island with his good buddy Ryan after a snowboardingaccide...原创 2018-11-13 18:35:11 · 206 阅读 · 0 评论 -
UVA 11076(数论 不全相异元素全排列)
题目链接:https://cn.vjudge.net/contest/269773?tdsourcetag=s_pcqq_aiomsg#problem/G题意:给你N个数,求把他们的全排列加和为多少参考https://www.cnblogs.com/hbutACMER/p/4235696.html考虑任意一位i,假设我们在i位放置x,则对应(n−1)!/(d0!∗d1!∗...∗dx!...原创 2018-11-15 20:31:45 · 592 阅读 · 0 评论 -
学习笔记: 自适应Simpson积分+例题
参考bloghttps://blog.csdn.net/lunch__/article/details/82288676https://blog.csdn.net/xyz32768/article/details/81392369这个东西对于三次以下的函数是正确的,但是对于三次以上的函数我们可以将其近似为低次函数套用Simpson公式,这个东西学名好像叫自适应Simpson积分。昨天AC...原创 2019-01-15 22:13:56 · 1943 阅读 · 0 评论 -
【Green公式】Hunter’s Apprentice(判断多边形为顺时针或逆时针)--鞋带公式
题目描述When you were five years old, you watched in horror as a spiked devil murdered your parents. You would have died too, except you were saved by Rose, a passing demon hunter. She ended up adopting ...原创 2019-04-13 16:45:02 · 8765 阅读 · 3 评论 -
GCDLCM(数学)+Miller-Rabin模板
题目:GCDLCM——http://icpc.upc.edu.cn/problem.php?cid=1745&pid=3题目描述In FZU ACM team, BroterJ and Silchen are good friends, and they often play some interesting games.One day they play a game a...原创 2019-05-02 18:20:57 · 195 阅读 · 0 评论 -
Greatest Common Divisor 2018CCPC桂林站G题解 备战省赛组队训练赛第十七场
题目描述There is an array of length n, containing only positive numbers.Now you can add all numbers by 1 many times. Please find out the minimum times you need to perform to obtain an array whose greate...原创 2019-05-03 18:06:22 · 432 阅读 · 1 评论 -
Floating-Point Hazard (数学定义QAQ)
题目描述Given the value of low, high you will have to find the value of the following expression:If you try to find the value of the above expression in a straightforward way, the answer may be incorre...原创 2019-04-29 17:35:24 · 177 阅读 · 0 评论 -
ACM-ICPC 2018 沈阳赛区网络预赛 G.Spare Tire (容斥)
题目链接:https://nanti.jisuanke.com/t/A1995题目大意根据题目中所给的公式,问在1–n中与m互质的和是多少;分析题意通过打表会发现aia_iai=(i+1)*i,那么原问题就可以转化成∑i=1ni(i+1)gcd(i,m)==1\sum_{i=1}^n i(i+1){gcd(i,m)==1}i=1∑ni(i+1)gcd(i,m)==1但是呢,我们需...原创 2019-05-05 14:54:38 · 187 阅读 · 0 评论 -
判断两个线段是否是有交点 upc 2019年第二阶段我要变强个人训练赛第三场 c题
题目描述给定N个线段。求有交点的线段对数。保证没有两条线段共线输入一行一个整数N,表示线段的个数第2~N+1行,每行四个实数,x1,y1,x2,y2,表示线段的两个端点(x1,y1)和(x2,y2)输出一行一个整数,表示有交点的线段对数。分析:https://www.cnblogs.com/wuwangchuxin0924/p/6218494.html参考了上面的那一片文章,我在...原创 2019-05-22 19:26:17 · 144 阅读 · 0 评论 -
POJ 3045 数学证明贪心解决 OR 二分
Farmer John's N (1 <= N <= 50,000) cows (numbered 1..N) are planning to run away and join the circus. Their hoofed feet prevent them from tightrope walking and swinging from the trapeze (and the...原创 2018-10-20 17:31:52 · 318 阅读 · 1 评论