POJ 2739 Sum of Consecutive Prime Numbers(素数)...
分类:
其他好文 时间:
2014-11-14 17:45:15
阅读次数:
160
public class HashAlgorithms { /** * 加法hash * @param key 字符串 * @param prime 一个质数 * @return hash结果 */ public static int additiveHash(String key, int pri...
分类:
其他好文 时间:
2014-11-14 10:43:05
阅读次数:
148
就是找素数。很水的题。模糊搜索一道题搜到的。
但是却 TLE 2次。把所有的 long long 改成 int ,%lld 改成 %d 就神奇的过了。
简直不可思议。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#def...
分类:
其他好文 时间:
2014-11-13 18:55:12
阅读次数:
176
Ice_cream’s world III
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 926 Accepted Submission(s): 303
Problem Description
ice_cr...
分类:
编程语言 时间:
2014-11-13 16:37:46
阅读次数:
260
Prime PathDescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to chang...
分类:
其他好文 时间:
2014-11-13 14:26:51
阅读次数:
200
反正知道了就是知道,不知道也想不到,很快#include #include #include using namespace std;inline void print_prime_k(long long p, long long k) { printf("%lld", p); ...
分类:
其他好文 时间:
2014-11-12 20:59:25
阅读次数:
211
Prime Distance
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 12811
Accepted: 3420
Description
The branch of mathematics called number theory is about p...
分类:
其他好文 时间:
2014-11-12 13:51:21
阅读次数:
248
还是畅通projectTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26860Accepted Submission(s): 11985Probl...
分类:
编程语言 时间:
2014-11-12 13:36:00
阅读次数:
272
【题意简述】:题意很简单,就是用连续的素数加和,计算有多少个这样的连续的素数数列可以使这个序列的和等于输入的数。
【分析】:很经典的素数模板,基本所有有关素数的题,我都会使用这个模板。
// 268K 16Ms
#include
using namespace std;
#define N 10000
bool isprime[N];
long long prime[1300],np...
分类:
其他好文 时间:
2014-11-10 21:50:41
阅读次数:
264
The Luckiest numbe
题目:
在满足|x| + |y|最小时候,让a*|x| + b*|y|最小。求:|x| + |y|最小值。
算法:
同余式的求解运用。
解体步骤:
1、先用gcd判断是否有解。(c%g == 0有解)
2、对式子求最简式。a' = a/g ; b' = b/g; c' = c/g;
3、运...
分类:
其他好文 时间:
2014-11-08 15:17:08
阅读次数:
80