Live2d Test Env

随笔分类 -  数学

上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要:描述 给一个整数N,请你求出以N为分母的最简(既约)真分数中第K小的是多少? 输入 两个整数N个K。 对于30%的数据,1 <= N <= 1000000 对于100%的数据,1 <= N <= 10000000000 且 1 <= K <= φ(N)。其中φ(N)是欧拉函数,也即1~N中与N互质的 阅读全文
posted @ 2017-12-26 20:36 nimphy 阅读(732) 评论(0) 推荐(0)
摘要:A game-board consists of N fields placed around a circle. Fields are successively numbered from1 to N clockwise. In some fields there may be obstacles 阅读全文
posted @ 2017-12-21 16:48 nimphy 阅读(488) 评论(0) 推荐(0)
摘要:When ?? was born, seven crows flew in and stopped beside him. In its childhood, ?? had been unfortunately fall into the sea. While it was dying, seven 阅读全文
posted @ 2017-12-17 21:14 nimphy 阅读(276) 评论(0) 推荐(0)
摘要:Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following: Choo 阅读全文
posted @ 2017-12-17 19:12 nimphy 阅读(234) 评论(0) 推荐(0)
摘要:King Arthur is an narcissist who intends to spare no coins to celebrate his coming K-th birthday. The luxurious celebration will start on his birthday 阅读全文
posted @ 2017-12-17 13:40 nimphy 阅读(446) 评论(1) 推荐(0)
摘要:Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotiona 阅读全文
posted @ 2017-12-16 20:22 nimphy 阅读(425) 评论(0) 推荐(0)
摘要:>On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave becau 阅读全文
posted @ 2017-12-16 16:31 nimphy 阅读(342) 评论(0) 推荐(0)
摘要:Problem Description Although winter is far away, squirrels have to work day and night to save beans. They need plenty of food to get through those lon 阅读全文
posted @ 2017-12-16 14:43 nimphy 阅读(266) 评论(0) 推荐(0)
摘要:Time limit per test: 2.0 seconds Memory limit: 512 megabytes Time limit per test: 2.0 seconds Memory limit: 512 megabytes Time limit per test: 2.0 sec 阅读全文
posted @ 2017-12-09 13:05 nimphy 阅读(535) 评论(8) 推荐(0)
摘要:Time limit per test: 2.0 seconds Memory limit: 256 megabytes Time limit per test: 2.0 seconds Memory limit: 256 megabytes Time limit per test: 2.0 sec 阅读全文
posted @ 2017-12-09 12:50 nimphy 阅读(787) 评论(0) 推荐(0)
摘要:问题: You live in a village but work in another village. You decided to follow the straight path between your house (A) and the working place (B), but t 阅读全文
posted @ 2017-12-08 10:21 nimphy 阅读(1135) 评论(0) 推荐(0)
摘要:数论四·扩展欧几里德 数论四·扩展欧几里德 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho周末在公园溜达。公园有一堆围成环形的石板,小Hi和小Ho分别站在不同的石板上。已知石板总共有m块,编号为 0..m-1,小Hi一开始站在s1号石板上,小Ho一开始站 阅读全文
posted @ 2017-11-17 22:37 nimphy 阅读(173) 评论(0) 推荐(0)
摘要:Problem Description 医学界发现的新病毒因其蔓延速度和Internet上传播的"红色病毒"不相上下,被称为"红色病毒",经研究发现,该病毒及其变种的DNA的一条单链中,胞嘧啶,腺嘧啶均是成对出现的。现在有一长度为N的字符串,满足一下条件:(1) 字符串仅由A,B,C,D四个字母组成 阅读全文
posted @ 2017-11-15 22:19 nimphy 阅读(314) 评论(0) 推荐(0)
摘要:前两天总结了素数筛法,其中就有Eular筛法。现在他又来了→→ φ(n),一般被称为欧拉函数。其定义为:小于n的正整数中与n互质的数的个数。 毕竟是伟大的数学家,所以以他名字命名的东西很多辣。 对于φ(n),我们有这样【三个性质】: (1) 【若n为素数】,则φ(n) = n - 1 显然,由于n为 阅读全文
posted @ 2017-11-14 12:14 nimphy 阅读(1011) 评论(0) 推荐(0)
摘要:Miller-Rabin Pollard-rho (输入一个数n,输出小于n且与n互素的整数个数) (大数欧拉,启发式分解) 拓展gcd 逆元 错排 排列组合 C(n,m) 先init 再comb(n,m) n在下 C(n,m) 不mod C(n,m) mod p (p为素数) C(n,m) mod 阅读全文
posted @ 2017-11-14 10:13 nimphy 阅读(314) 评论(0) 推荐(1)
摘要:一:【普通筛法】 从2一直除到n(或者√n),有可以整除的不是素数。 二:【Eratosthenes筛法】 如果一个数p是质数的话,那么它的倍数一定都是质数。所以我建立了一个布尔类型的数组isPrime,初始化都为true。我从2开始枚举,当我找到一个isPrime[p]仍然为true时,可以确定p 阅读全文
posted @ 2017-11-13 12:57 nimphy 阅读(455) 评论(0) 推荐(1)
摘要:无论是哪一个,都可以用公式来求,而不是暴力求,见 Hiho Coder1621 : 超市规划 POJ 1160: Post Office 1,x轴上找一个点,使得它到已知的点的距离和最小 下标为中值的点x=a[(1+n)/2] 2,x轴上找一个点,使得它到已经的点的距离的平方和最小 重心x=(a1+ 阅读全文
posted @ 2017-11-13 08:21 nimphy 阅读(384) 评论(0) 推荐(1)
摘要:跳舞链 跳舞链 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Ho最近遇到一个难题,他需要破解一个棋局。 棋局分成了n行,m列,每行有若干个棋子。小Ho需要从中选择若干行使得每一列有且恰好只有一个棋子。 比如下面这样局面: 其中1表示放置有棋子的格子,0表示没有放置 阅读全文
posted @ 2017-11-07 17:50 nimphy 阅读(259) 评论(0) 推荐(0)
摘要:1144 : 01串 1144 : 01串 时间限制:7000ms 单点时限:1000ms 内存限制:256MB 描述 给定两个整数n和m,求是否存在恰好包含n个0和m个1的01串S,使得S中不存在子串"001"和"11"。 如果存在符合条件的01串则输出字典序最小的S,否则输出NO。 输入 一行两 阅读全文
posted @ 2017-11-06 08:48 nimphy 阅读(151) 评论(0) 推荐(0)
摘要:春天到了, HDU校园里开满了花, 姹紫嫣红, 非常美丽. 葱头是个爱花的人, 看着校花校草竞相开放, 漫步校园, 心情也变得舒畅. 为了多看看这迷人的校园, 葱头决定, 每次上课都走不同的路线去教室, 但是由于时间问题, 每次只能经过k个地方, 比方说, 这次葱头决定经过2个地方, 那他可以先去问 阅读全文
posted @ 2017-10-29 13:38 nimphy 阅读(182) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 下一页