码迷,mamicode.com
首页 >  
搜索关键字:using    ( 53562个结果
hdu3068 最长回文(manacher 算法)
题意:           给定字符串,求字符串中的最长回文序列 解题思路:           manacher 算法           时间复杂度:O(N) 代码: #include #include #include #define MAXN 110010 using namespace std; char b[MAXN],a[MAXN<<1]; int p[MA...
分类:编程语言   时间:2015-08-02 06:26:31    阅读次数:146
算法题:剔除字符串(很有意思)
/* 两个字符串A、B。从A中剔除存在于B中的字符。 比如A = “hello world”, B = "er",那么剔 除之后A变为"hllo wold"。空间复杂度要求是O(1) ,时间复杂度越优越好。 */ #include #include using namespace std; void Grial(char *str,char *ptr) {...
分类:编程语言   时间:2015-08-02 06:24:28    阅读次数:127
HackerRank - "Lego Blocks"
A combination of different DP passes.https://www.hackerrank.com/challenges/lego-blocks/editorial#include #include #include using namespace std;typedef...
分类:其他好文   时间:2015-08-02 06:23:17    阅读次数:187
hdu 1285 确定比赛名次(给一个拓扑有序图要求输出拓扑有序序列)
1.如果有向图无回路,那么该图拓扑有序。 2代码: #include #include using namespace std; int mat[505][505]; int n,m; int in[505]; void topological_sort() { int cnt=n; while(cnt--) { int i; for...
分类:其他好文   时间:2015-08-02 01:06:26    阅读次数:125
Ubuntu下“超级终端”的使用
本文以USB转串口为例!PC自带的串口从ttyS0起(ttyS0-COM1、ttyS1-COM2以此类推)。 一、查找串口设备 dmesg | grep usb     我们会看到PL2303映射在ttyUSB0端口上。 [ 1.797793] usb 2-1.6: new full-speed USB device number 4 using ehci-pci [ 1.89...
分类:系统相关   时间:2015-08-02 01:04:28    阅读次数:245
最短路径问题
最短路径 在无向图 G=(V,E) 中,假设每条边 E[i] 的长度为 w[i],找到由顶点 V0 到其余各点的最短值。 #include "stdafx.h" #include #include using namespace std; #define N 9 #define MIN 1000000 typedef struct{ int vexnum, arcnum; char ...
分类:其他好文   时间:2015-08-02 01:02:03    阅读次数:101
hdu_2817_快速幂
水~#include #include #include #include #include #include #include using namespace std; #define MAX(x,y) (((x)>(y))?(x):(y)) #define MIN(x,y)...
分类:其他好文   时间:2015-08-02 01:00:24    阅读次数:188
扩展kmp 模板
算法可以参考http://wenku.baidu.com/view/8e9ebefb0242a8956bece4b3.html百度文库#include #include using namespace std; const int MM=100005; int next[MM],extand...
分类:其他好文   时间:2015-08-02 00:57:09    阅读次数:222
经测试可用的汉字转拼音及汉字取首字母
using System;using System.Data;using System.Configuration;using System.Text;/// /// Summary description for ConvertHzToPz_Gb2312 /// public class Co.....
分类:其他好文   时间:2015-08-02 00:54:51    阅读次数:340
hdu 5126 cdq+Treap+BIT
这题说的是给了三维空间然后操作 寻求在 x1,y1,z1 x2, y2, z2; (x1#include #include #include using namespace std;const int maxn=50005;struct point{ int x,y,z,delt,qnum,k...
分类:其他好文   时间:2015-08-02 00:50:18    阅读次数:188
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!