码迷,mamicode.com
首页 >  
搜索关键字:ans    ( 3741个结果
最长递增的子序列(模板)
一般情况: [cpp] view plaincopy #include   #include   #include   using namespace std;    int a[1005],dp[1005],n;    int LIS()  {      int i,j,ans,m;      dp[1] = 1;      ans = 1;      for(i = 2...
分类:其他好文   时间:2014-07-20 09:28:19    阅读次数:280
poj 2109 Power of Cryptography
Power of Cryptography Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 18408   Accepted: 9292 题目大意  给出两个数n,k 要你求个数ans  ans^n=k 关于题目中的数据范围完全可以用double完爆  没必要用到二分...
分类:其他好文   时间:2014-07-20 00:15:46    阅读次数:196
uva 1368 - DNA Consensus String
题目上给的样例input格式存在一定问题,行末多空格。 在这上面纠结了几次…… #include #include #include const int maxn = 1100; int A[maxn]; int C[maxn]; int G[maxn]; int T[maxn]; char ans[maxn]; int ans_; int m,n; void judge(int pos) ...
分类:其他好文   时间:2014-07-19 23:26:29    阅读次数:347
模板,BFS
#include #include #include using namespace std; struct node { int x,y,step; }; char map[105][105]; int vis[105][105]; int to[4][2]= {1,0,-1,0,0,1,0,-1}; int n,m,sx,sy,ex,ey,ans; int check(in...
分类:其他好文   时间:2014-07-19 23:11:19    阅读次数:330
Fence Repair
有n(n>=1&&n1&&node[i]>n) { node[0]=0; for(i=1;i>node[i]; inheap(node[i]); } __int64 ans=0; for(i=1;i...
分类:其他好文   时间:2014-07-19 23:02:20    阅读次数:190
uva 11181
直接枚举计算就行;#include#include#include#define maxn 22using namespace std;double ans[maxn],p[maxn];bool vis[maxn];int n,r;void dfs(int cur,int cot){ if(c...
分类:其他好文   时间:2014-07-19 15:37:13    阅读次数:158
CSU-ACM2014暑假集训基础组训练赛(1) 解题报告
?Problem A HDU 4450 水题,签到题水题。。没啥好说的。给大家签到用的。 1 #include 2 int main(){ 3 int n,a,ans; 4 while(scanf("%d",&n),n){ 5 ans = 0; 6 ...
分类:其他好文   时间:2014-07-19 13:33:32    阅读次数:300
Power Strings
poj2406:http://poj.org/problem?id=2406题意:给你一个串,让你找出这个串是由哪个串循环得到,出处循环的次数。题解;知道了KMP,用next数组直接搞定。判断ans=len%(len-next[len])==0?len/(len-next[len]):1; 1 #i...
分类:其他好文   时间:2014-07-19 12:21:07    阅读次数:391
GCD SUM 强大的数论,容斥定理
GCD SUMTime Limit:8000/4000MS (Java/Others)Memory Limit:128000/64000KB (Java/Others)SubmitStatusProblem Description给出N,M执行如下程序:long long ans = 0,ansx ...
分类:其他好文   时间:2014-07-19 09:15:30    阅读次数:234
CodeForces 42C Safe cracking 规律题
题目链接:点击打开链接 3个数为一组,找最大的一个数让它减少,则显然是有解的,分类讨论一下即可 #include #include #include #include #include using namespace std; int n, k; int a[4]; vector >ans; int maxpos(){ int pos = 0; for(int i = 1; i < 4; ...
分类:其他好文   时间:2014-07-19 08:21:07    阅读次数:227
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!