上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页
摘要: 参考资料:百度百科,https://www.cnblogs.com/zwfymqz/p/8253530.html 1. 欧几里得距离 计算公式(n维空间下) 二维:dis=sqrt( (x1-x2)^2 + (y1-y2)^2 ) 三维:dis=sqrt( (x1-x2)^2 + (y1-y2)^2 阅读全文
posted @ 2018-03-20 20:53 月亮茶 阅读(28788) 评论(2) 推荐(4) 编辑
摘要: 【问题描述】已知 n 元线性一次方程组。a1,1x1+a1,2x2+…+a1,nxn=b1a2,1x1+a2,2x2+…+a2,nxn=b2………………an,1x1+an,2x2+…+an,nxn=bn其中: n<=50.系数是整数,绝对值<=100 , bi的值都是正整数且<300。编程任务:根据 阅读全文
posted @ 2018-03-20 15:06 月亮茶 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 1. 判断一个数字x二进制下第i位是不是等于1。 方法:if ( ( ( 1 << ( i - 1 ) ) & x ) > 0) 将1左移i-1位,相当于制造了一个只有第i位上是1,其他位上都是0的二进制数。然后与x做与运算,如果结果>0,说明x第i位上是1,反之则是0。 2. 将一个数字x二进制下 阅读全文
posted @ 2018-03-19 08:10 月亮茶 阅读(266) 评论(0) 推荐(1) 编辑
摘要: Lucas定理 用来求 C(n,m) mod p,p为素数的值。 计算组合数取模,适用于n很大p较小的时候,可以将计算简化到小于p 公式: 例题: 题目背景 这是一道模板题。 题目描述 给定n,m,p(1<=n,m,p<=10^5) 求C[n+m,m]%P 保证P为质数 C表示组合数。 一个测试点内 阅读全文
posted @ 2018-03-16 15:51 月亮茶 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1.C[n,m]=n!/(m!*(n-m)!)=C[n,n-m] 2.C[n,m]=C[n,n-m] 3.C[n,m]=C[n-1,m-1]+C[n-1,m] 阅读全文
posted @ 2018-03-16 15:01 月亮茶 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Time Limit: 10 Sec Memory Limit: 128 MB Description Recently, the cows have been competing with strings of balanced parentheses and comparing them wit 阅读全文
posted @ 2018-03-14 20:00 月亮茶 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 1 Description 2 3 For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to k 阅读全文
posted @ 2018-03-13 18:55 月亮茶 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Description Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we thin 阅读全文
posted @ 2018-03-13 18:32 月亮茶 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Description The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly 阅读全文
posted @ 2018-03-13 17:28 月亮茶 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Time Limit:1000MS Memory Limit:65536K Total Submissions:45636 Accepted:18224 Description The French author Georges Perec (1936–1982) once wrote a book 阅读全文
posted @ 2018-03-13 16:32 月亮茶 阅读(133) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页