自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(110)
  • 收藏
  • 关注

原创 CCF CSP JSON查询

update#include <iostream>#include <string>#include <stdlib.h>#include <cstdio>#include &am

2018-04-26 11:59:13 433

原创 Useful Ubuntu Tips

Emacsmake the caps lock to ctrl : setxkbmap -layout us -option ctrl:nocaps

2019-03-02 22:17:41 157

原创 POJ 1472

自己对于这道题目的理解 主要参考的代码链接 传送门BEGIN LOOP n OP 4 LOOP 3 LOOP n OP 1 END OP 2 END OP 1 END OP 17 OP 17 LOOP n OP 4 LOOP 3 LOOP n ...

2018-09-06 20:50:51 195

原创 c++中vector的拷贝构造过程

c++ 中std::vector的拷贝构造过程 文章来自阿里校招的一道面试题目,向vector中push n个对象,问对象的构造函数,拷贝构造函数,析构函数分别调用了几次?vector中的内存分配策略vector的底层是用动态数组来存储的,当我们用vector<T> vect 这样的形式声明的时候,数组的长度是0,当我们插入第一个元素的时候,数组的长度会变为1,当插...

2018-08-21 11:37:56 4437

原创 POJ 2479

很好的思路,同时从前面和后面计算最大的连续序列和,然后遍历中间点,得出最大值。#include<stdio.h>#include<iostream>#include<algorithm>#include<functional>#include<vector>#include<string.h>using nam...

2018-07-06 15:03:04 205

原创 POJ 4044

#include<stdio.h>#include<iostream>#include<algorithm>#include<functional>#include<vector>#include<string.h>using namespace std;vector<int> vect1;vect

2018-07-06 11:05:43 185

原创 CPP 字符串工具类

c++字符串常用操作字符串转化为整形int string_to_int(string s){ return atoi(s.c_str());}整形转化为字符串string tostring(int a){ stringstream ss; ss<<a; return ss.str();}字符转化为字符串st...

2018-06-29 17:06:09 352

原创 POJ 1094

Thinking in topological sorthow to judge if has a loopwhen there are still some unvisited node, but the number of node whose in-degree==0 equals zero, we can say: there is a loop in the graph.ho...

2018-05-27 15:07:25 160

原创 POJ 3026

#include <iostream>#include <algorithm>#include <vector>#include <map>#include <string>#include <queue>#include <cstring>#include <cstdio&gt

2018-05-27 11:58:07 230

原创 scanf 返回值的总结

返回值代表的是正确匹配的参数个数如果只读到一个EOF,则返回值为EOFint a;while(scanf("%d", &a)==EOF)break;int a;while(~scanf("%d", &a))都可以代表如果数据读取完成,跳出循环。...

2018-05-26 14:18:39 9229

原创 CCF CSP 游戏

这道题目让我更加理解BFS对于求最短路径的重要性,如果需要多次访问一个节点,可以在再添加一个维度。#include <iostream>#include <algorithm>#include <vector>#include <map>#include <string>#in

2018-05-23 19:04:29 424

原创 CCF CSP 地铁修建

#include <iostream>#include <algorithm>#include <vector>#include <map>#include <string>#include <queue>#include <cstring>using namespace std;const in

2018-05-22 10:56:14 176

原创 CCF CSP 通信网络

传递闭包问题(a->b&&b->c)--->(a->c)floyd这样做是超时的。#include <iostream>#include <math.h>#include <string.h>#include &amp

2018-05-21 21:54:50 521

原创 CCF CSP 交通规划

吐槽: CCF绝对是最垃圾的OJ,没有之一,我内存超了,从错误类型中没看出来…..为了防止内存超了,利用临接链表为了防止时间超了,利用优先队列,其他的比较简答了。#include <iostream>#include <math.h>#include <string.h>#include <stdio.h>#includ...

2018-05-21 16:53:39 401

原创 Floyd算法的一点思考

Floyd算法是解决任意两点最短路径的经典DP算法。状态方程假设i~ji~ji\text{~}j的最短路径经过中间结点kkk,则δ(i,j)=δ(i,k)+δ(k,j)δ(i,j)=δ(i,k)+δ(k,j)\delta(i,j)=\delta(i, k)+\delta(k, j) 我们令算法的状态转移方程为 f(k,i,j)=min(f(k−1,i,j),f(k−1,i,...

2018-05-19 10:45:19 281

原创 CCF CSP 行车路线

#include <iostream>#include <stdio.h>#include <string.h>#include <queue>using namespace std;typedef long long int LL;const LL MAXSIZE = 502;const LL INF = 0x3f3

2018-05-18 17:28:33 1023

原创 CCF CSP URL映射

#include <iostream>#include <string>#include <stdlib.h>#include <cstdio>#include <map>#include <vector>using namespace std;map<string, string> dict;ve

2018-05-05 15:56:03 1193

原创 POJ 1472

#include <iostream>#include <cstdio>#include <string>#include <sstream>#include <cstring>using names

2018-05-02 15:49:11 220

原创 POJ 2965

自己简答的实现了一个队列 * 当push操作的时候,tail++ * 当pop操作的时候,head++暂时没有考虑队列满和空的情况#include <iostream>#include <string.h>using namespace std;int visit[1<<16];int pre[1<<16];int Q[1&...

2018-04-30 22:04:44 109

原创 POJ 1753

#include <iostream>#include <queue>using namespace std;int visit[1<<16+10];queue<int > Q;int getnext(int temp, int x, int y){ temp ^= 1<<(4*x+y); if (x-1&gt...

2018-04-30 18:46:37 204

原创 Float Vs Double

visual IEEEmake use of the property of union keyword#include <stdio.h>union FloatingPointIEEE754 { struct { unsigned int mantissa : 23; unsigned int exponent : 8; ...

2018-04-29 17:44:09 89

原创 step by step calculator parser

this is my first choice#include <iostream>#include <string>#include <stdio.h>#include <assert.h>#include <map>#include <printf.h>#include <sstream...

2018-04-28 14:41:53 123

原创 Big Float

题目链接#include <iostream>#include <string>#include <algorithm>#include <stdio.h>using namespace std;int part_carrier;struct Float { string num_int; string num...

2018-04-27 07:33:58 284

原创 浮点数的大数问题

#include <iostream>#include <string>#include <algorithm>#include <stdio.h>using namespace std;int part_carrier;struct Float { string num_int; string num_part;...

2018-04-24 13:41:09 310 1

原创 POJ 3295

#include <algorithm>#include <string>#include <map>#include <set>#include <assert.h>#include <iostream>#include <vector>#include <stack>

2018-04-24 13:34:30 147

原创 c++ split函数简单实现

#include <string.h>#include <string>#include <vector>#include <iostream>#include <sstream>using namespace std;vector<string> split(string str, const string ...

2018-04-21 12:25:23 692

原创 POJ 2993

#include <iostream>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <vector>#include <string>#include <sstream>using namespace std;c

2018-04-21 11:44:11 113

原创 cpp traits初体验

为什么要有traits编程技巧我现在接触的还比较少,我感觉traits的作用就相当于一个提取类型的机器,然后都统一为一个类型,似的相同的逻辑不因为类型问题而出现大量的冗余代码,下面是一个简单的例子。#include <iostream>#include <vector>using namespace std;template<typename T&gt...

2018-04-20 20:41:59 395

原创 POJ 1573

#include <iostream>#include <stdio.h>#include <string.h>using namespace std;int rows, cols;const int MAXSIZE = 12;int start;char road[MAXSIZE][MAXSIZE];int visit[MAXSIZE][MAX...

2018-04-20 17:03:19 153

原创 CCF CSP Crontab

这道题目可以从以下几点来分析,遍历给定起点到终点的每一分钟,然后去配置文件中查找,但是这样会超时,我们转化一下思路,遍历配置文件中的时间,根据产生的日期检查其是否有效,这样检查的时间大大减少。工具函数准备利用stringstream实现string和int之间的相互转化。string int_to_string(int a){ /** * 将给定的整数变为字符串...

2018-04-19 22:39:18 1822

原创 一个简单的万年历的实现

由于CPP中没有自带的date类,自己造了一个,待优化。//// Created by chaomaer on 2018/4/18.//#ifndef SIMPLE_OJ_DATE_H#define SIMPLE_OJ_DATE_H#include <iostream>#include <string>#include <cstdlib&gt...

2018-04-18 19:59:21 1293

原创 POJ 2632

#include <iostream>#include <string>#include <string.h>#include <stdio.h>#include <vector>using namespace std;const int MAXSIZE = 25;int testcase;int A, B; // 东西,...

2018-04-18 00:05:31 128

原创 POJ 3436

#include <iostream>#include <stdio.h>#include <string.h>#include <algorithm>#include <queue>using namespace std;int P; // 零件数量int N; // 机器数量// 为了最后的打印结果,需要保存流的变化过...

2018-04-11 22:58:02 108

原创 POJ 1459

#include <iostream>#include <stdio.h>#include <string.h>#include <string>#include <queue>using namespace std;const int MAXSIZE = 102;const int INF = 0x3f3f3f3f;in...

2018-04-10 16:38:17 80

原创 POJ 3020

#include <iostream>#include <stdio.h>#include <string.h>#include <string>using namespace std;const int MAXSIZE = 42;int road[MAXSIZE][MAXSIZE];int visit[500];int res[5...

2018-04-09 15:01:44 143

原创 c++ store class as vaule in map

#include <string>#include <iostream>#include <map>class ClassA{public : ClassA(int num) { id = num; }private: int id;};int main(){ std::map < std::string, C...

2018-04-07 19:47:05 279

原创 POJ 1416

#include <iostream>#include <stdio.h>#include <string>#include <string.h>#include <vector>#include <map>#include <cstdlib>using namespace std;int tar

2018-04-07 16:40:16 145

原创 POJ 1129

#include <iostream>#include <stdio.h>#include <string>#include <cmath>#include <string.h>#include <set>#include <vector>#include <algorithm&

2018-04-04 16:26:49 173

原创 POJ 2531

#include <iostream>#include <stdio.h>#include <string>#include <cmath>#include <string.h>#include <set>#include <algorithm>using namespace std;int ro

2018-04-04 14:40:52 88

原创 POJ 2676

#include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <string>#include <queue>#include <map>#include <set>usin

2018-04-04 12:16:55 102

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除