上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 31 下一页
摘要: Happy 2006 Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 11956 Accepted: 4224 Description Two positive integers are said to be relatively 阅读全文
posted @ 2017-04-03 14:07 joeylee97 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Description Ms. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of medicine. For example, to measure 200mg of aspiri 阅读全文
posted @ 2017-04-03 12:56 joeylee97 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 拓展欧几里得定理主要用来求解同余线性方程,求逆元等,遇到题目给出形如ax+by==c,要求一组满足要求的x和y时,可以联系扩展欧几里得求解 拓展欧几里得由 gcd(a,b) = gcd(b,a%b) 推出 由于 a*x + b*y == gcd(a,b) 必定有解 所以 b*x + (a%b)*y 阅读全文
posted @ 2017-04-03 12:40 joeylee97 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinatio 阅读全文
posted @ 2017-04-03 11:21 joeylee97 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Description Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating 阅读全文
posted @ 2017-04-02 14:15 joeylee97 阅读(308) 评论(0) 推荐(0) 编辑
摘要: Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator. There are 16 handle 阅读全文
posted @ 2017-04-02 13:02 joeylee97 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Problem Description RSA is one of the most powerful methods to encrypt data. The RSA algorithm is described as follow:> choose two large prime integer 阅读全文
posted @ 2017-04-02 09:36 joeylee97 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Problem Description 要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input 数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 阅读全文
posted @ 2017-04-02 09:04 joeylee97 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 欧几里得辗转相除法求最大公约数 int gcd(int a,int b) { if(b==0) return a; else return gcd(b,a%b); } 求组合数 int C(int n ,int m) { int i,a,fz=1,fm=1; for( i = 1; i #define M 1000000007 int fp(int a,int b,int c)... 阅读全文
posted @ 2017-04-01 16:44 joeylee97 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的: 首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排; 然后,让各位新郎寻找自己的新娘.每人只准找一个,并且不允许多人找一个. 最后,揭开盖 阅读全文
posted @ 2017-04-01 16:20 joeylee97 阅读(226) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 31 下一页