Live2d Test Env

随笔分类 -  数学

摘要:把一个数的约数个数定义为该数的复杂程度,给出一个n,求1-n中复杂程度最高的那个数。 例如:12的约数为:1 2 3 4 6 12,共6个数,所以12的复杂程度是6。如果有多个数复杂度相等,输出最小的。 Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 100) 第2 阅读全文
posted @ 2018-06-07 14:35 nimphy 阅读(179) 评论(0) 推荐(0)
摘要:一个集合S的优美值定义为:最大的x,满足对于任意i∈1,x1,x,都存在一个S的子集S',使得S'中元素之和为i。 给定n个集合,对于每一次询问,指定一个集合S1和一个集合S2,以及一个数k,要求选择一个S2的子集S3(|S3|<=k),使得S1∪S3的优美值最大。 (集合元素可以重复) Input 阅读全文
posted @ 2018-06-02 16:31 nimphy 阅读(385) 评论(0) 推荐(0)
摘要:Factorial numbers are getting big very soon, you'll have to compute the number of divisors of such highly composite numbers. Input The first line cont 阅读全文
posted @ 2018-05-23 12:21 nimphy 阅读(279) 评论(0) 推荐(0)
摘要:cathetus(直角边); hypotenuse(斜边) spoj:Structures 给定三角形的直角边,问可以有多少种三角形。 T<=10 , N<=1e15 ,times<=1s. spoj:Shared cathetus (easy) 给定三角形的直角边,问可以有多少种三角形。T<=1e 阅读全文
posted @ 2018-05-22 23:06 nimphy 阅读(404) 评论(0) 推荐(0)
摘要:都是取的模板,这几天做的素数题挺多的,所以整理了放在这里,感觉有一天回用到的! SPOJ:Nth Prime: 求第N个素数,N<1e9。 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=2 阅读全文
posted @ 2018-05-21 14:02 nimphy 阅读(340) 评论(0) 推荐(0)
摘要:The weather is fine today and hence it's high time to climb the nearby pine and enjoy the landscape. The pine's trunk includes several branches, locat 阅读全文
posted @ 2018-05-15 18:44 nimphy 阅读(302) 评论(0) 推荐(0)
摘要:Bert is a programmer with a real fear of floating point arithmetic. Bert has quite successfully used rational numbers to write his programs but he doe 阅读全文
posted @ 2018-05-14 19:23 nimphy 阅读(354) 评论(0) 推荐(0)
摘要:You are given an array of size N. How many distinct arrays can you generate by swapping two numbers for exactly once? The two selected numbers can be 阅读全文
posted @ 2018-04-20 20:27 nimphy 阅读(351) 评论(0) 推荐(0)
摘要:Katniss Everdeen after participating in Hunger Games now wants to participate in NT Games (Number Theory Games). As she begins President Snow provides 阅读全文
posted @ 2018-04-20 16:38 nimphy 阅读(328) 评论(0) 推荐(0)
摘要:Do you think that magic is simple? That some hand-waving and muttering incomprehensible blubber is enough to conjure wonderful gardens or a fireball t 阅读全文
posted @ 2018-04-17 16:29 nimphy 阅读(277) 评论(0) 推荐(0)
摘要:The hacker Michael develops breakthrough password manager, which is called KEK (Keeper of Encrypted Keys). A distinctive feature of KEK is excellent s 阅读全文
posted @ 2018-04-16 22:28 nimphy 阅读(305) 评论(0) 推荐(0)
摘要:You're given a sequence s of N distinct integers.Consider all the possible sums of three integers from the sequence at three different indicies.For ea 阅读全文
posted @ 2018-04-04 21:06 nimphy 阅读(496) 评论(0) 推荐(0)
摘要:描述 一日,崔克茜来到小马镇表演魔法。 其中有一个节目是开锁咒:舞台上有 n 个盒子,每个盒子中有一把钥匙,对于每个盒子而言有且仅有一把钥匙能打开它。初始时,崔克茜将会随机地选择 k 个盒子用魔法将它们打开。崔克茜想知道最后所有盒子都被打开的概率,你能帮助她回答这个问题吗? 输入 第一行一个整数 T 阅读全文
posted @ 2018-03-29 19:46 nimphy 阅读(431) 评论(0) 推荐(0)
摘要:Input Output Sample Input 由公式,ans=2^(N-1)%Mod=2^((N-1)%(Mod-1)+(Mod-1)) %Mod。 注意:降幂的之后再加一个Mod-1保险,避免为负,比如此题出入1000000006时,就出问题了。 阅读全文
posted @ 2018-03-19 20:23 nimphy 阅读(263) 评论(0) 推荐(0)
摘要:链接:https://www.nowcoder.com/acm/contest/70/D 题目: 定义一个数字为幸运数字当且仅当它的所有数位都是4或者7。 比如说,47、744、4都是幸运数字而5、17、467都不是。 现在想知道在1...n的第k小的排列中,有多少个幸运数字所在的位置的序号也是幸运 阅读全文
posted @ 2018-03-16 23:52 nimphy 阅读(729) 评论(0) 推荐(0)
摘要:Today Pari and Arya are playing a game called Remainders. Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the 阅读全文
posted @ 2018-03-13 17:51 nimphy 阅读(415) 评论(0) 推荐(1)
摘要:Two soldiers are playing a game. At the beginning first of them chooses a positive integer n and gives it to the second soldier. Then the second one t 阅读全文
posted @ 2018-03-12 15:42 nimphy 阅读(260) 评论(0) 推荐(0)
摘要:In a certain course, you take n tests. If you get ai out of bi questions correct on test i, your cumulative average is defined to be . Given your test 阅读全文
posted @ 2018-03-07 23:06 nimphy 阅读(231) 评论(0) 推荐(0)
摘要:Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now he wants to construct his luck 阅读全文
posted @ 2018-03-04 16:02 nimphy 阅读(329) 评论(0) 推荐(0)
摘要:A friend of yours has taken the job of security officer at the Star-Buy Company, a famous depart- ment store. One of his tasks is to install a video s 阅读全文
posted @ 2018-03-04 12:59 nimphy 阅读(159) 评论(0) 推荐(0)