码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
C++求2进制01不同的位数
#include using namespace std; int Grial(int x,int y) { int count = 0; while(x!=0 || y!=0) { if( ((x&0x1) ^ (y&0x1)) ) count++; x>>=1; y>>=1; } return count; } int main() { cout<<Grial(...
分类:编程语言   时间:2015-05-01 10:42:25    阅读次数:149
KMP(二)
#include #include #include using namespace std;int main() { char a[10050],s[1000007]; int c;scanf("%d",&c); while(c--) { scanf("%s%s",a,s);...
分类:其他好文   时间:2015-05-01 10:41:31    阅读次数:149
hdu 3068 Manacher算法
题意:求最长回文串,模板题 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #define MOD 100000000710 const int...
分类:编程语言   时间:2015-05-01 10:34:19    阅读次数:124
zoj 2913 Bus Pass
对于每个输入的站点求出所有点到这个站点的最短路。用anss数组存下来,然后就可以用anss数组求出答案了。题目分析清楚了 还是比较水的,折腾了一早上。。#include#include#include#include#include#includeusing namespace std;struct...
分类:其他好文   时间:2015-05-01 10:31:37    阅读次数:135
c#如何实现一个线程暂停,等待用户输入文本后继续运行?
using System;using System.Text;using System.Windows.Forms;using System.Threading;namespace WindowsApplication1{ public partial class Form1 : Form ...
分类:编程语言   时间:2015-05-01 10:30:29    阅读次数:181
一些项目——二维数组的置换
题目描述 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换。 输入 一个3x3的矩阵 输出 转置后的矩阵 样例输入 1 2 3 4 5 6 7 8 9 样例输出 1 4 7 2 5 8 3 6 9 解答 #include using namespace std; void zhuang...
分类:编程语言   时间:2015-05-01 09:23:20    阅读次数:190
简单递归换递推。
//这是递归#includeusing namespace std;int f(int n) { if(n==0 || n==1) return 1; return f(n-2) + f(n/2);}int main() { int n; cin >> n; cout ...
分类:其他好文   时间:2015-05-01 01:50:22    阅读次数:117
HDU 1010 Tempter of the Bone
题意:一个n*m的迷宫,从起点到终点,问是否恰能在t个单位时间到达;思路:dfs遍历各种可能情况,奇偶剪枝;#include#include#include#include#includeusing namespace std;char mm[55][55];int vis[55][55];int ...
分类:其他好文   时间:2015-05-01 00:28:02    阅读次数:220
北大ACM2456——Aggressive cows~~二分搜索
这一题,也是简单的二分搜索,求解放置的牛之间的距离尽可能远,也就是最大化最小值。 主要的一步就是将第i头牛放在了x[j]的位置中,第i + 1 头牛就要放在满足x[j] + d ,k的最小值。 下面是AC的代码: #include #include using namespace std; int N, M; int X[100005]; bool C(int x) { int ...
分类:其他好文   时间:2015-04-30 23:19:52    阅读次数:378
Agri-Net.(POJ-1258)(最小生成树)
最小生成树算法。 #include #include #include #include #include #include using namespace std; const int INF = 1000000000; int cost[105][105]; int mincost[105]; bool used[105]; int n,a; int prim() { for(int...
分类:Web程序   时间:2015-04-30 21:57:26    阅读次数:143
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!