码迷,mamicode.com
首页 >  
搜索关键字:prime    ( 2475个结果
POJ1811 Prime Test(判断随机素数)
题意:给出一个N(2 #include #include #include #include #include #include #include #include using namespace std;/* ********************************************...
分类:其他好文   时间:2015-10-20 19:27:33    阅读次数:201
poj 3126 Prime Path (BFS)
DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four...
分类:其他好文   时间:2015-10-19 20:49:43    阅读次数:245
【面试题】C语言:实现一个函数,判断一个数是不是素数。
#include<stdio.h> #include<math.h> intmain() { intnum=0; intret=0; printf("pleaseinputthenumber:\n"); scanf("%d",&num); ret=prime(num); if(ret==1) { printf("%disprime",num); } else { printf("%disnotprime",num); } return0; } ..
分类:编程语言   时间:2015-10-17 07:11:37    阅读次数:253
ZOJ 3911 Prime Query ZOJ Monthly, October 2015 - I
Prime QueryTime Limit:1 Second Memory Limit:196608 KBYou are given a simple task. Given a sequenceA[i]withNnumbers. You have to perform Q operations o...
分类:其他好文   时间:2015-10-16 20:26:22    阅读次数:315
ZOJ 2015 10月份 月赛 3911 Prime Query
这道题我改啊,改啊,交啊,就对了。#include #include #include #include#include using namespace std;const int N = 10000005;const int M = 100005;int a[N];int p[M];int tre...
分类:其他好文   时间:2015-10-13 22:51:16    阅读次数:274
hdu5478 Can you find it
Can you find it Time Limit: 8000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 822 Accepted Submission(s): 365 Problem Description Given a prime number C...
分类:其他好文   时间:2015-10-11 11:38:37    阅读次数:166
Leetcode Count Primes
Description:Count the number of prime numbers less than a non-negative number,n.解题思路:神一样的提示一步步给出了最佳解法。The Sieve of Eratosthenes uses an extra O(n) mem...
分类:其他好文   时间:2015-10-11 09:02:16    阅读次数:214
LeetCode 263-Ugly Number
Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For examp...
分类:其他好文   时间:2015-10-08 21:33:52    阅读次数:165
LeetCode OJ:Ugly Number(丑数)
Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For examp...
分类:其他好文   时间:2015-10-07 11:59:16    阅读次数:371
LeetCode OJ:Count Primes(质数计数)
Count the number of prime numbers less than a non-negative number,n.计算小于n的质数的个数,当然就要用到大名鼎鼎的筛法了,代码如下,写的有点乱不好意思。 1 class Solution { 2 public: 3 int ...
分类:其他好文   时间:2015-10-06 23:48:41    阅读次数:383
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!