码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
csu 2014 summer training day 2 莫比乌斯反演
SPOJ VLATTICE题意:x,y,z 2 #include 3 #include 4 #include 5 #define maxn 1001000 6 #define LL long long 7 using namespace std; 8 9 int K[maxn];10 in...
分类:其他好文   时间:2014-07-22 00:15:33    阅读次数:454
NBUT 1576 炒鸡想减肥的字符串
借鉴了  nenu_xlp  的思想; 先把‘a’到‘a’+m-1的字符找到,在将其中的序号最大的减去最小的,在不断更新每个字母对应的序号,重复之前的步骤比较的出最小的结果。。 #include #include #include #include using namespace std; int t[27]; char s[1005]; int q[27]; int b,c; int s...
分类:其他好文   时间:2014-07-22 00:13:36    阅读次数:167
stringstream中的clear()与str()
今天在用stringstream做数据转换的时候,遇到了问题,发现得到的不是预期的结果。简化的代码如下:#include #include #include using namespace std; int main(int argc, char * argv[]){ stringstr...
分类:其他好文   时间:2014-07-22 00:11:38    阅读次数:325
HDU 4462
状态压缩,K#include using namespace std;struct pos{ int x,y;}p[15];int f[55][55],r[15];int n,k;int abs(int a){ if(an)continue; for(int j=abs(i)-l;jn)contin...
分类:其他好文   时间:2014-07-22 00:08:34    阅读次数:232
【HDOJ】2364 Escape
bfs.题目做的不细心,好多小错误。尤其注意起始点就是边界的情况。wa了八次。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 85 8 9 type...
分类:其他好文   时间:2014-07-22 00:06:36    阅读次数:279
POJ 3264
这道题作为线段树的入门题吧,不涉及更新。 代码挺长的,所以在敲的时候挺多地方出了问题。#include#include#includeusing namespace std;const int N = 50010;const int INF = 0x3f3f3f3f;int rmin = INF, ...
分类:其他好文   时间:2014-07-21 23:39:33    阅读次数:198
poj3041 Asteroids --- 最小点覆盖
#include #include #include #include #include #include #include const int maxn=510; using namespace std; int my[maxn],mx[maxn],vis[maxn],e[maxn][maxn],n; int path(int i) { int j; for(j=1;j<=n...
分类:其他好文   时间:2014-07-21 23:29:42    阅读次数:199
450A - Jzzhu and Children 找规律也可以模拟
挺水的一道题,规律性很强,在数组中找出最大的数max,用max/m计算出倍数t,然后再把数组中的书都减去t*m,之后就把数组从后遍历找出第一个大于零的就行了 #include #include using namespace std; int main(){ // freopen("in.txt","r",stdin); int a[105],n,m; while(~sca...
分类:其他好文   时间:2014-07-21 23:29:23    阅读次数:312
hdu 1711 Number Sequence
直接套KMP模板 #include #include #include using namespace std; int s[1000005],w[10005],next[10005]; int b,c; void show() { int i,j; i=0; next[0]=-1; j=-1; while(i<c) { if(j=...
分类:其他好文   时间:2014-07-21 23:29:03    阅读次数:334
双链表的简单应用
/*当对单链表理解后,对双链表就好理解多了,单链表就是只有在结构体或者类中只有一个指针用来存储下一个节点的地址,双链表就是在里面有两个指针,一个用来存储上一个节点的地址,一个用来存储下一个节点的地址。这样的链表就叫双链表。*/ #include using namespace std; struct Node {     int a;     Node *prior,*next;   ...
分类:其他好文   时间:2014-07-21 16:32:55    阅读次数:218
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!