码迷,mamicode.com
首页 >  
搜索关键字:prime    ( 2475个结果
python读取一个文件的每一行判断是否为素数,并把结果写到另一个文件中
刚刚学习python的菜鸟,这道题包括:文件的读写,python的参数调用,异常的使用,函数的使用 创建一个文本文件inti_prime.txt 执行命令:python Prime.py init_prime.txt result_prime.txt 会生成一个result_prime.txt文件 ...
分类:编程语言   时间:2016-12-04 23:32:39    阅读次数:538
【转载】公钥、私钥、数字签名等知识
参考这篇文章,讲得很好:http://www.blogjava.net/yxhxj2006/archive/2012/10/15/389547.html 来自:http://www.ruanyifeng.com/blog/2011/08/what_is_a_digital_signature.htm ...
分类:其他好文   时间:2016-12-04 14:11:06    阅读次数:865
Leetcode 313. super ugly number
Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes ...
分类:其他好文   时间:2016-12-02 14:12:22    阅读次数:167
UVa 524 Prime Ring Problem(回溯法)
传送门 Description A ring is composed of n (even number) circles as shown in diagram. Put natural numbers 1, 2, . . . , n into each circle separately, an ...
分类:其他好文   时间:2016-12-01 02:31:23    阅读次数:214
图论学习
一、最短路问题和最小生成树。 带权图分为有向和无向,无向图的最短路径又叫做最小生成树,有prime算法和kruskal算法;有向图的最短路径算法有dijkstra算法和floyd算法。 生成树的概念:联通图G的一个子图如果是一棵包含G的所有顶点的树,则该子图称为G的生成树 生成树是联通图的极小连通子 ...
分类:其他好文   时间:2016-11-30 19:56:49    阅读次数:224
Euler's totient function
https://en.wikipedia.org/wiki/Euler's_totient_function counts the positive integers up to a given integer n that are relatively prime to n. if two num ...
分类:其他好文   时间:2016-11-30 03:18:14    阅读次数:154
POJ2739(尺取法)
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 23931 Accepted: 13044 Description Some positive integers c ...
分类:其他好文   时间:2016-11-29 06:22:07    阅读次数:182
USACO 3.1 Humble Numbers
For a given set of K prime numbers S = {p1, p2, ..., pK}, consider the set of all numbers whose prime factors are a subset of S. This set contains, fo ...
分类:其他好文   时间:2016-11-27 16:54:50    阅读次数:248
Leetcode #28. Implement strStr()
Brute Force算法,时间复杂度 O(mn) Rabin karp算法时间复杂度可以降低到 O(mn) on average. haystack: abcdefgh, needle: abc needle_code = a + b*p + c*p^2 使用sliding window计算hay ...
分类:其他好文   时间:2016-11-27 09:55:30    阅读次数:181
[POJ2109]Power of Cryptography
[POJ2109]Power of Cryptography 试题描述 Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers amo ...
分类:其他好文   时间:2016-11-26 11:47:03    阅读次数:249
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!