
数学
文章平均质量分 81
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
【Codeforces - 769D】k-Interesting Pairs Of Integers(暴力,统计,思维,数学,异或)
题干:Vasya has the sequence consisting ofnintegers. Vasya consider the pair of integersxandyk-interesting, if their binary representation differs from each other exactly inkbits. For example, ...原创 2019-10-31 20:42:40 · 571 阅读 · 0 评论 -
【CodeForces - 701D】As Fast As Possible(二分,模拟,数学公式)
题干:On vacationsnpupils decided to go on excursion and gather all together. They need to overcome the path with the lengthlmeters. Each of the pupils will go with the speed equal tov1. To get to...原创 2019-10-25 12:53:56 · 357 阅读 · 0 评论 -
【CodeForces - 124C】Prime Permutation(数学,思维,小结论)
题干:You are given a strings, consisting of small Latin letters. Let's denote the length of the string as|s|. The characters in the string are numbered starting from1.Your task is to find out if ...原创 2019-10-11 20:27:38 · 295 阅读 · 0 评论 -
【CodeForces - 485D】Maximum Value (枚举,用数组离散化,数学,取模运算,因子,筛法)
题干:You are given a sequence a consisting of n integers. Find the maximum possible value of (integer remainder of ai divided by aj), where 1 ≤ i, j ≤ n and ai ≥ aj.InputThe first line contains i...原创 2019-02-21 14:16:23 · 348 阅读 · 0 评论 -
【EOJ Monthly 2019.02 - D】进制转换(思维,取模,高精度大数)
题干:单测试点时限: 2.0 秒内存限制: 256 MB“他觉得一个人奋斗更轻松自在。跟没有干劲的人在一起厮混,只会徒增压力。”QQ 小方决定一个人研究研究进制转换。很快,QQ 小方就遇到问题了。他现在想知道在十进制范围 [l,r] 内有多少整数满足在 k 进制下末尾恰好有 m 个 0 。比如在十进制下的 24 在二进制下是 11000 ,我们称十进制下的 24 在二进制下...原创 2019-02-26 14:47:16 · 316 阅读 · 0 评论 -
【EOJ Monthly 2019.01 - E】唐纳德先生与假骰子(假概率问题)
题干:单测试点时限: 6.0 秒内存限制: 1024 MB嗨,唐纳德先生又来了。他又带了一枚假骰子,这个骰子的各个面的点数依然是 1,2,3,4,5,6 ,但是六个面向上的概率却不一定都是 1/6 ,而变成了 p1,p2,p3,p4,p5,p6 。现在它要跟你玩一个游戏。首先你也得准备一枚骰子,各个面的点数同样是 1,2,3,4,5,6 ,但是六个面向上的的概率分别是 q1,q...原创 2019-02-26 14:58:55 · 443 阅读 · 0 评论 -
【计蒜客 - 2019南昌邀请赛网络赛 - K】MORE XOR(数学,找规律,打表)
Given a sequence ofnnnumbersa_1, a_2, \cdots, a_na1,a2,⋯,anand three functions.Define a functionf(l,r)f(l,r)which returns\oplus a[x]⊕a[x](l \le x \le rl≤x≤r). The\oplus⊕represents exclu...原创 2019-04-20 20:13:59 · 376 阅读 · 0 评论 -
【Kattis - triangle 】Sierpiński Circumference(数学,求位数,取对数或Java)
题干:Polish mathematician Wacław Sierpiński(1882-1969) described the 2D geometric figure known as the Sierpińskitriangle as part of his work on set theory in 1915. The triangle, which is really an i...原创 2019-03-10 16:16:14 · 356 阅读 · 0 评论 -
【CodeForces - 485A】Factory (水题,抽屉原理,tricks)
题干:One industrial factory is reforming working plan. The director suggested to set a mythical detail production norm. If at the beginning of the day there were x details in the factory storage, then...原创 2019-02-19 20:43:18 · 379 阅读 · 0 评论 -
【CodeForces - 485C】Bits (二进制相关,数学,贪心)
题干:Let's denote as the number of bits set ('1' bits) in the binary representation of the non-negative integer x.You are given multiple queries consisting of pairs of integers l and r. For each qu...原创 2019-02-19 19:47:16 · 521 阅读 · 0 评论 -
【EOJ Monthly 2019.02 - B】解题(思维,抽屉原理,暴力,模运算,优化,tricks)
题干:单测试点时限: 2.0 秒内存限制: 1024 MB“我把房门上锁,并非为了不让她进去,而是为了防止自己逃到她身边”。她又被数学难住了。QQ 小方当然是不会对女生说”不”的。她的数学题是这样的,她得到了一个十进制大整数,这个大整数只包含 1 - 9 这 9 个数字。现在,要求选出其中连续的一段数字,把其他未被选中的数字全部变成 0 ,并且使得变换以后的大整数恰好是 m...原创 2019-02-26 14:47:05 · 375 阅读 · 0 评论 -
【牛客 - 318E】爱摸鱼的Dillonh(数学,暴力,细节)
题干:“我不做人啦,jojo!”“Dillonh起来回答问题!”“啊?”沉迷于jojo的Dillonh又一次上课摸鱼被老师抓到了,他慌忙地抬起头看着讲台上火冒三丈的老师。“给你一个数n,现在要找到一个集合AA,AA中若干数a1,a2,……ama1,a2,……am,使得n=a1∗a2∗a3∗……∗amn=a1∗a2∗a3∗……∗am,同时对于任意的i和j(1≤i,j≤n1≤i,j≤n...原创 2019-02-13 20:30:25 · 273 阅读 · 0 评论 -
【EOJ Monthly 2019.02 - F】方差(数学,前缀和,积的前缀和)
题干:单测试点时限: 2.0 秒内存限制: 256 MB“放弃不难,但坚持一定很酷。”QQ 小方已经在体育馆苦练一天射箭了,但他还在坚持。QQ 小方每天都要在朋友圈晒自己的训练记录。他一共进行了 n 次射箭,成绩分别是 x1,x2,⋯,xn 。为了表现自己的发挥十分稳定,QQ 小方决定选出其中的 m 次成绩,使得他们的方差是所有可以选择的方案中最小的。对于 m 个元素组成的...原创 2019-02-23 11:30:37 · 362 阅读 · 0 评论 -
【51nod - 1098】 最小方差(基础数学,公式化简,前缀和,积的前缀和)
题干:若x1,x2,x3……xn的平均数为k。 则方差s^2 = 1/n * [(x1-k)^2+(x2-k)^2+…….+(xn-k)^2] 。 方差即偏离平方的均值,称为标准差或均方差,方差描述波动程度。 给出M个数,从中找出N个数,使这N个数方差最小。 Input 第1行:2个数M,N,(M > N, M <= 10000) 第2 - M + 1行:M个数的具体值(0...原创 2018-10-08 00:57:21 · 1270 阅读 · 0 评论 -
【Gym - 101608G】WiFi Password (区间或,线段树 或 按位处理+尺取 或 二分)
题干:Just days before the JCPC, your internet service went down. You decided to continue your training at the ACM club at your university. Sadly, you discovered that they have changed the WiFi passwor...原创 2019-04-04 16:51:21 · 362 阅读 · 0 评论 -
【HDU - 6185】Covering(矩阵快速幂优化二维dp,高斯消元,轮廓线dp打表)
题干:Bob's school has a big playground, boys and girls always play games here after school.To protect boys and girls from getting hurt when playing happily on the playground, rich boy Bob decided to...原创 2019-04-10 11:53:24 · 285 阅读 · 0 评论 -
【HDU - 6186】CS Course(按位与,按位或,按位异或的区间统计,二进制拆位)
题干:Little A has come to college and majored in Computer and Science.Today he has learned bit-operations in Algorithm Lessons, and he got a problem as homework.Here is the problem:You are givin...原创 2019-04-10 21:09:54 · 413 阅读 · 0 评论 -
【Codeforces - 798C】 Mike and gcd problem(思维,贪心)
题干:Mike has a sequenceA = [a1, a2, ..., an]of lengthn. He considers the sequenceB = [b1, b2, ..., bn]beautiful if thegcdof all its elements is bigger than1, i.e..Mike wants to change his ...原创 2019-10-11 15:24:45 · 204 阅读 · 0 评论 -
【ZOJ - 3329】One Person Game(带循环的概率dp,数学期望,高斯消元,数学)
题干:There is a very simple and interesting one-person game. You have 3 dice, namelyDie1,Die2andDie3.Die1hasK1faces.Die2hasK2faces.Die3hasK3faces. All the dice are fair dice, so the pr...原创 2019-07-28 14:53:49 · 277 阅读 · 0 评论 -
【CodeForces - 1047C】Enlarge GCD(数学,枚举,预处理打表,思维)
题干:F先生有n个正整数,a1,a2,...,an他认为这些整数的最大公约数太小了,所以他想通过删除一些整数来扩大它您的任务是计算需要删除的最小整数数,以便剩余整数的最大公约数大于所有整数的公约数.Input31 2 4Output1Input46 9 15 30Output2Input31 1 1Output-1题目大意:...原创 2019-08-05 20:09:04 · 461 阅读 · 0 评论 -
【2019牛客暑期多校训练营(第一场) - H】XOR(线性基,期望的线性性)
题干:链接:https://ac.nowcoder.com/acm/contest/881/H来源:牛客网Bobo has a set A of n integers a1,a2,…,ana1,a2,…,an.He wants to know the sum of sizes for all subsets of A whose xor sum is zero modulo (10...原创 2019-07-22 20:59:10 · 480 阅读 · 0 评论 -
【HDU 4394】Digital Square(bfs,数位搜索,思维,数学)
题干:Given an integer N,you should come up with the minimumnonnegativeinteger M.M meets the follow condition: M2%10x=N (x=0,1,2,3....)InputThe first line has an integer T( T< = 1000), the n...原创 2019-07-07 10:48:28 · 244 阅读 · 0 评论 -
【CodeForces - 1152C 】Neko does Maths(数学数论,lcm,gcd性质)
题干:给出a,b<=1e9,你要找到最小的k使得lcm(a+k,b+k)尽可能小,如果有多个k给出同样的最小公倍数,输出最小的一个k。解题报告:因为题目中k太多了,先化简一下公式,假设a>b ,则gcd(a+k,b+k) == gcd(a+k,a+b);下面给出一个简单证明:z=gcd(a+k,b+k);所以:(a+k)%z==0,(b+k)%z==0;...原创 2019-07-15 17:11:34 · 397 阅读 · 0 评论 -
【HDU - 5468】Puzzled Elena(容斥原理,dfs序,数学,素因子分解,有坑)
题干: Problem Description Since both Stefan and Damon fell in love with Elena, and it was really difficult for her to choose. Bonnie, her best friend, suggested her to throw a question to them,...原创 2019-07-15 14:37:22 · 252 阅读 · 0 评论 -
【2019浙江省赛 - B】Element Swapping(思维,数学)
题干:DreamGrid has an integer sequenceand he likes it very much. Unfortunately, his naughty roommate BaoBao swapped two elementsand() in the sequence when DreamGrid wasn't at home. When DreamGri...原创 2019-04-27 19:00:02 · 1110 阅读 · 0 评论 -
【ZOJ - 3870】Team Formation(异或,思维)
题干:For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team fromNstudents of his university.Edward knows the skill level of each student. He ha...原创 2019-04-17 20:45:14 · 221 阅读 · 0 评论 -
【牛客 - 551F】CSL 的神奇序列(推公式,猜结论,母函数)
题干:链接:https://ac.nowcoder.com/acm/contest/551/F来源:牛客网题目描述CSL 有一个神奇的无穷实数序列,他的每一项满足如下关系:对于任意的正整数 n ,有 , 并且 。CSL 很清楚这样的序列是唯一的,他现在想考考你,你能快速告诉他这个序列的第 n 项是多少吗?为了不让你感到难过,对每次询问你只要输出 倍的 对 99824...原创 2019-04-08 10:55:40 · 309 阅读 · 0 评论 -
【蓝桥杯官网试题 -算法训练】素因子去重(数学,数论,因子约数)
题干:问题描述 给定一个正整数n,求一个正整数p,满足p仅包含n的所有素因子,且每个素因子的次数不大于1输入格式 一个整数,表示n输出格式 输出一行,包含一个整数p。样例输入1000样例输出10数据规模和约定 n<=10^12 样例解释:n=1000=2^3*5*3,p=2*5=10 解题报告: 就是个整数的唯一性分...原创 2019-02-17 21:12:07 · 827 阅读 · 0 评论 -
【CodeForces - 347C 】Alice and Bob (思维,数学,等差数列)
题干:It is so boring in the summer holiday, isn't it? So Alice and Bob have invented a new game to play. The rules are as follows. First, they get a set of n distinct integers. And then they take turn...原创 2018-12-06 09:44:14 · 956 阅读 · 0 评论 -
【CodeForces - 27E】Number With The Given Amount Of Divisors (数论,数学,反素数)
题干:Given the numbern, find the smallest positive integer which has exactlyndivisors. It is guaranteed that for the givennthe answer will not exceed1018.InputThe first line of the input con...原创 2018-12-08 12:44:53 · 367 阅读 · 0 评论 -
【CodeForces - 922B 】Magic Forest (数学,异或,暴力,水题,三元组问题)
题干:Imp is in a magic forest, where xorangles grow (wut?)A xorangle of order n is such a non-degenerate triangle, that lengths of its sides are integers not exceeding n, and the xor-sum of the le...原创 2018-11-28 15:09:58 · 595 阅读 · 0 评论 -
【牛客 - 301哈尔滨理工大学软件与微电子学院第八届程序设计竞赛同步赛(高年级)】小乐乐的组合数+(取模,数学,思维)
题干:小乐乐得知一周有7天之后就对7产生了兴趣。小乐乐得到了两堆数字数字时连续的。第一堆包含[1,n]n个数字,第二堆包含[1,m]m个数字。小乐乐想要从两堆中各挑选出一个整数x,y,使得x,y的和为7的倍数。请问小乐乐有多少种组合的方式。 输入描述:输入整数n,m。(1<=n,m<=1e6)输出描述:输出满足的对数。 示例1输入...原创 2018-12-02 21:44:28 · 4757 阅读 · 0 评论 -
【CodeForces - 892C 】Pride (数学,思维构造,gcd)
题干:You have an array a with length n, you can perform operations. Each operation is like this: choose two adjacent elements from a, say x and y, and replace one of them with gcd(x, y), where gcd den...原创 2018-12-08 10:55:13 · 310 阅读 · 0 评论 -
【CodeForces - 289E 】Polo the Penguin and XOR operation (数学,异或,贪心)
题干:Little penguin Polo likes permutations. But most of all he likes permutations of integers from 0 to n, inclusive.For permutation p = p0, p1, ..., pn, Polo has defined its beauty — number .Exp...原创 2018-11-28 14:57:10 · 312 阅读 · 0 评论 -
【CodeForces - 151C】Win or Freeze (博弈,数学,唯一素数分解)
题干:You can't possibly imagine how cold our friends are this winter in Nvodsk! Two of them play the following game to warm up: initially a piece of paper has an integer q. During a move a player shou...原创 2018-11-21 18:54:38 · 525 阅读 · 0 评论 -
【POJ - 2909 】Goldbach's Conjecture (哥德巴赫猜想,数论,知识点结论)
题干:For any even number n greater than or equal to 4, there exists at least one pair of prime numbers p1 and p2 such thatn = p1 + p2This conjecture has not been proved nor refused yet. No one is ...原创 2018-11-12 21:07:08 · 569 阅读 · 0 评论 -
【POJ - 2262】Goldbach's Conjecture (数论,哥德巴赫猜想,知识点结论)
题干:In 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture: Every even number greater than 4 can be written as the s...原创 2018-11-12 20:59:38 · 418 阅读 · 0 评论 -
【 HDU - 5363】Key Set(水题,快速幂,组合数学)
题干:soda has a set SS with nn integers {1,2,…,n}{1,2,…,n}. A set is called key set if the sum of integers in the set is an even number. He wants to know how many nonempty subsets of SS are key set....原创 2018-11-12 20:46:26 · 334 阅读 · 0 评论 -
【HDU - 2200】Eddy's AC难题(简单组合数学)
题干:Eddy是个ACMer,他不仅喜欢做ACM题,而且对于Ranklist中每个人的ac数量也有一定的研究,他在无聊时经常在纸上把Ranklist上每个人的ac题目的数量摘录下来,然后从中选择一部分人(或者全部)按照ac的数量分成两组进行比较,他想使第一组中的最小ac数大于第二组中的最大ac数,但是这样的情况会有很多,聪明的你知道这样的情况有多少种吗? 特别说明:为了问题的简化,我们这里假...原创 2018-11-05 22:01:51 · 292 阅读 · 0 评论 -
【POJ - 2301 】Beat the Spread! (简单数学)
题干: Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members...原创 2018-11-05 21:57:40 · 523 阅读 · 0 评论