码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
HUST信心大涨迎省赛之《我要冲银牌》K——字符串——Kia's Calculation
DescriptionDoctor Ghee is teaching Kia how to calculate the sum of two integers. But Kia is so careless and alway forget to carry a number when the su...
分类:其他好文   时间:2015-04-19 21:11:16    阅读次数:163
[编程之美]资格赛 B Palindrome
既然这个是资格赛,  时间也比较充裕, 我就讲解一下我做题的过程 Time Limit:2000ms Case Time Limit:1000ms Memory Limit:256MB Description Given a string, calculate the number of subsequences that are palindrome. ...
分类:其他好文   时间:2015-04-18 13:10:38    阅读次数:162
埃拉托斯特尼素数筛法
1//埃拉托斯特尼筛法23intprime[maxx];4boolis_prime[maxx+1];//is_prime[i]为true表示i为素数56//返回n以内素数的个数7intsieve(intn)8{9intp=0;10for(inti=0;i<=n;i++)is_prime[i]=1;1...
分类:其他好文   时间:2015-04-17 21:41:40    阅读次数:119
hdu Prime Ring Problem
简单的dfs,貌似这道题用暴力枚举就可以了,毕竟数据开的是比较小的。#include"iostream"#include"algorithm"#include"stdio.h"#include"string.h"#include"string"#include"vector"#include"cma...
分类:其他好文   时间:2015-04-17 18:02:04    阅读次数:103
HDU 1003 - Max Sum(难度:*)
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-04-16 17:17:35    阅读次数:124
[POJ 1365] Prime Land
Prime LandTime Limit:1000MSMemory Limit:10000KTotal Submissions:3211Accepted:1473DescriptionEverybody in the Prime Land is using a prime base number s...
分类:其他好文   时间:2015-04-16 11:45:47    阅读次数:157
【USACO】Prime Palindromes(暴力暴力再暴力)
把所有符合条件的数全部记下来,扫一遍就行了,这类数最多2W来个 /* ID: 18906421 LANG: C++ PROG: pprime */ #include #include #include #include using namespace std; const int maxn = 20005; int a,b; int cnt = 0; int prime[maxn]; bool ...
分类:其他好文   时间:2015-04-14 21:34:36    阅读次数:164
HDU 3415 Max Sum of Max-K-sub-sequence(单调队列)
Problem Description Given a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n] , and the right neighbour of A[n] is A[1]. Now your job is to calculate...
分类:其他好文   时间:2015-04-14 19:49:36    阅读次数:133
NOJ1545---New Year 2014(数位dp)
问题描述In the New Year 2014, Xiao Ming is thinking about the question: give two integers N and K, Calculate the number of the numbers of satisfy the following conditions: It is a positive integer and is n...
分类:其他好文   时间:2015-04-14 16:42:31    阅读次数:119
poj 2429 GCD & LCM Inverse miller_rabin素数判定和pollard_rho因数分解
题意: 给gcd(a,b)和lcm(a,b),求a+b最小的a和b。 分析: miller_rabin素数判定要用费马小定理和二次探测定理。pollard_rho因数分解算法导论上讲的又全又好,网上的资料大多讲不清楚。 代码://poj 2429 //sep9 #include #include #include #define gcc 10007 #define max_prime...
分类:其他好文   时间:2015-04-14 08:32:43    阅读次数:141
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!