码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
Max Sum(hd P1003)
Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7)...
分类:其他好文   时间:2015-05-10 06:18:27    阅读次数:154
UVA 10200 Prime Time 暴力水题
一个简单的暴力水题,只是输出方式让人无语。。。 #include #include int prime(int n) { int i; for(i=2;i*i<=n;i++) { if((n%i)==0) return 0; } return 1; } int main() { int num[10010...
分类:其他好文   时间:2015-05-09 23:40:32    阅读次数:211
hdu 1016 Prime Ring Problem
dfs水题 #include #include #define maxn 20+5 #define pr 100000 using namespace std; int n; int visit[maxn]; int re[maxn]; int ans; int u[pr]={0}; void prime() { int i,j; u[0]=1,u[1]=1; for(i=2;i<pr;...
分类:其他好文   时间:2015-05-09 16:30:25    阅读次数:105
Count Primes
Description:Count the number of prime numbers less than a non-negative number,nclick to show more hints.References:How Many Primes Are There?Sieve of ...
分类:其他好文   时间:2015-05-09 13:11:21    阅读次数:119
Number Sequence
Number SequenceProblem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).InputT...
分类:其他好文   时间:2015-05-08 22:08:18    阅读次数:144
1349: [Baltic2006]Squint
1349: [Baltic2006]SquintTime Limit:1 SecMemory Limit:64 MBSubmit:427Solved:248[Submit][Status][Discuss]DescriptionWrite a program to calculate integer...
分类:其他好文   时间:2015-05-08 12:16:52    阅读次数:110
Word Frequency
Write a bash script to calculate the frequency of each word in a text filewords.txt.For simplicity sake, you may assume:words.txtcontains only lowerca...
分类:其他好文   时间:2015-05-08 09:23:19    阅读次数:103
LeetCode (36) Count Primes
题目描述Count the number of prime numbers less than a non-negative number, n。本题要求我们求出小于n的数中共有多少个质数。相信大部分同学在刚开始学习C语言的时候估计都写过判断一个数为质数的程序。一般的思路为:bool isPrime(int num) { int s = sqrt(num) + 1; for( i...
分类:其他好文   时间:2015-05-07 16:46:37    阅读次数:91
数据库 - 范式(Normal Form, NF)
码设K为R中的属性或属性组合。若K U, 则K称为R的侯选码,或候选键(Candidate Key)。 若候选码多于一个,则选定其中的一个做为主码,或主键(Primary Key)。 主属性与非主属性 包含在任何一个候选码中的属性 ,称为主属性(Prime attribute) 不包含在任何码中的属性称为非主属性(Nonprime attribute)或非码属性(N...
分类:数据库   时间:2015-05-07 10:29:58    阅读次数:240
poj1258 Agri-Net +hdu 1233 还是畅通工程 (最小生成树Prime算法)
Agri-Net Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 43215   Accepted: 17683 Description Farmer John has been elected mayor of his town! One of his campaig...
分类:编程语言   时间:2015-05-07 08:52:09    阅读次数:150
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!