C. Really Big Numbers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks…
C. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) an…
本文同步发布在CSDN:https://blog.csdn.net/weixin_44385565/article/details/90486252 1104 Sum of Number Segments (20 分)   Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.…
有趣的数学规律 椭圆 双曲线 抛物线都叫圆锥曲线 它们跟圆锥有着怎样的关系? 他们都是圆锥与平面在不同姿势下交配的产物. 参考 椭圆 抛物线 小结 e: 离线率 P: 任意一点 F: 焦点 准线: 一条直线 离心率 完美的圆轨离心率为0,椭圆的离线率在0到1之间,也就是说这个范围内,离心率越大,轨道就椭圆的越厉害(长短半轴差距越大.) 这里有很多天体的知识点 圆轨道:e=0\,\!, 椭圆轨道:{\displaystyle 0<e<1\,\!}, 抛物线轨道:e=1\,\!, 双曲线轨道:e&…
[BZOJ2876][NOI2012]骑行川藏(数学,二分答案) 题面 BZOJ 题解 我们有一个很有趣的思路. 首先我们给每条边随意的赋一个初值. 当然了,这个初值不会比这条边的风速小. 那么,我们可以先计算一下当前所需要的总能量. 剩下的能量我们分成若干等份. 每次从所有的边中,选择一个加了这一份能量后,时间减少最多的那条边,让他提速. 直到我们所有的能量都分配完,此时答案一定最优. 所以,可以简化一下题意. 在\(\sum ks(v'-v)^2=E_U\)的情况下,最小化\(\sum \f…
#1584 : Bounce 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 For Argo, it is very interesting watching a circle bouncing in a rectangle. As shown in the figure below, the rectangle is divided into N×M grids, and the circle fits exactly one grid. The bouncing…
Magic Numbers CodeForces - 628D dp函数中:pos表示当前处理到从前向后的第i位(从1开始编号),remain表示处理到当前位为止共产生了除以m的余数remain. 不一定要把a减一,也可以特判a自身,或者直接改记忆化搜索. #include<cstdio> #include<cstring> #define md 1000000007 typedef long long LL; LL m,d,ans1,ans2,len1; LL ans[][][]…
[Codeforces 1199C]MP3(离散化+二分答案) 题面 给出一个长度为n的序列\(a_i\)和常数I,定义一次操作[l,r]可以把序列中<l的数全部变成l,>r的数全部变成r.每次操作的代价为改变数的个数.问:要让操作后序列里不同数的个数\(k\)满足$n \lceil \log _2 k\rceil \leq 8I $,操作的最小代价 分析 首先把a离散化,这样[l,r]都在\(10^5\)的级别.枚举l,发现r显然有单调性.操作后不同数的个数随r的增大而减小(考虑极端情况l=…
题意: 一堆人用方块盖塔,有n个人每次只能加两块方块,有m个人每次只能加三块方块.要求每个人盖的塔的高度都不一样,保证所用方块数最少,求最高的塔的高度. 0<=n+m  0<=n,m<=1e6 思路: 根据容斥原理,n和m个人如果都按照等差为2或者3的序列盖塔的话那么重复的个数应该是塔高较小的那组除以6,然后....一开始顺着这个思路想把自己坑了... 其实可能的塔高是有规律的 2 3 4 6 8 9 10 12...每六个中有三个,所以干脆先打表了,那么知道n和m之后,至少需要n+m种…
Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks that a positive integer number x is really big if the difference between x and the sum of its digits (in decimal representation) is…