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
一个简单的暴力水题,只是输出方式让人无语。。。
#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
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
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 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]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
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
题目描述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
码设K为R中的属性或属性组合。若K U, 则K称为R的侯选码,或候选键(Candidate Key)。
若候选码多于一个,则选定其中的一个做为主码,或主键(Primary Key)。
主属性与非主属性
包含在任何一个候选码中的属性 ,称为主属性(Prime attribute)
不包含在任何码中的属性称为非主属性(Nonprime attribute)或非码属性(N...
分类:
数据库 时间:
2015-05-07 10:29:58
阅读次数:
240
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