码迷,mamicode.com
首页 >  
搜索关键字:打表    ( 1320个结果
完美数(打表)
完美数 Time Limit:1000MSMemory Limit:65536KB64bit IO Format:%lld & %lluDescription任何一个自然数的约数中都有1和它本身,我们把小...
分类:其他好文   时间:2014-11-22 21:21:25    阅读次数:178
ACM学习历程——HDU1331 Function Run Fun(锻炼多维dp的打表)
Description We all love recursion! Don't we? Consider a three-parameter recursive function w(a, b, c): if a 20 or b > 20 or c > 20, then w(a, b, c) r....
分类:其他好文   时间:2014-11-20 21:51:02    阅读次数:210
zoj 2822 Sum of Different Primes (01背包)
///给你n 求他能分解成多少个的不同的k个素数相加之和 ///01背包,素数打表 # include # include # include # include # include using namespace std; int cot; int used[1500]; int prime[1500]; void sushu()///素数打表 { memset(used,0,...
分类:其他好文   时间:2014-11-19 20:36:45    阅读次数:299
BZOJ 1002 FJOI 2007 轮状病毒 暴力+找规律+高精度
题目大意: 思路:基尔霍夫矩阵求生成树个数,不会。 但是可以暴力打表。(我才不会说我调试force调试了20分钟。。。 CODE(force.cc): #include #include #include #include #define MAX 1000 using namespace std; struct Edge{ int x,y; Edge(...
分类:其他好文   时间:2014-11-19 18:53:47    阅读次数:222
BZOJ1228 [SDOI2009]E&D
蒟蒻不会= =话说写题解的巨巨也只会打表233反正先A掉再说 1 /************************************************************** 2 Problem: 1228 3 User: rausen 4 Language...
分类:其他好文   时间:2014-11-18 23:28:38    阅读次数:661
Bestcoder round 18---A题(素数筛+素数打表+找三个素数其和==n)
Primes ProblemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12Accepted Submission(s): 11Problem ...
分类:其他好文   时间:2014-11-15 21:46:16    阅读次数:273
[数论] hdu 3988 Harry Potter and the Hide Story
题意: 给N、K,问满足 n!%(k^x)=0 最大的x。 思路: 首先当k=1的时候,输出inf 然后就是,因为要整除,所以我们就分解k的质因子 假设每个质因子有si个,那么对应的n!里面有sumi个 那么对于当前因子最大的x=suni/si 然后就是所有的因子找最小值了。 这里需要打表 10^7的素数表 代码: #include"cstdlib" #include"cstd...
分类:其他好文   时间:2014-11-11 19:15:15    阅读次数:263
【暴力】洛谷 P1328 NOIP2014提高组 day1 T1 生活大爆炸版石头剪刀布
把所有情况打表,然后随便暴力。 1 #include 2 using namespace std; 3 int n,an,bn,p1,p2; 4 int a[10001],b[10001]; 5 bool f[6][6]; 6 int ans1,ans2; 7 void init() 8 { 9 ....
分类:其他好文   时间:2014-11-11 12:10:49    阅读次数:190
POJ 2739 Sum of Consecutive Prime Numbers(素数打表水题)
【题意简述】:题意很简单,就是用连续的素数加和,计算有多少个这样的连续的素数数列可以使这个序列的和等于输入的数。 【分析】:很经典的素数模板,基本所有有关素数的题,我都会使用这个模板。 // 268K 16Ms #include using namespace std; #define N 10000 bool isprime[N]; long long prime[1300],np...
分类:其他好文   时间:2014-11-10 21:50:41    阅读次数:264
LeetCode 51 N-Queens II
Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 思路1:打表 public class Solution { public int totalNQ...
分类:其他好文   时间:2014-11-10 19:58:54    阅读次数:220
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!