自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

代码艺术的道与术

个人笔记,欢迎交流,仅供参考

  • 博客(13)
  • 资源 (1)
  • 收藏
  • 关注

原创 编译原理词法分析

目前错误处理只做了  float c = 2.5.4 ;  double d = 25AB67;  这两种情况。#include #include #include #include #include #include #include #include using namespace std;set key_word;set oper;set bound;

2015-04-28 21:35:36 815

原创 2015年校赛总结

题目名为“校赛总结”,其实更想换成“Rainbow为什么五题滚粗?!”。作为今年校赛大二没拆的两个队伍之一,结果打成这样,没脸见人了,总结起来就是我认为自己今天SB了。主要有以下几点:1.我今天状态的确不好,最后卡的那道B题跟去年在农大校赛上遇见的那题类似,在最后那段时间我已经有思路了,可是由于当时不敢写。等到最后15分钟才开始敲,加上我用很麻烦的Dijstra那种方法,调试起来好多细节要处理

2015-04-12 20:01:38 652

原创 hihocoder1051(枚举贪心)

题目链接:点击打开链接解题思路:明显要消除连续的m才能使收益最大,我们直接暴力的枚举好了,每个区间的a[i + m ] - a[ i - 1] - 1的最大值即所求。这里在左右边界分别添上0和100完整代码:#include #include #include #include #include using namespace std;int n , m

2015-04-09 21:22:36 1074

原创 hihocoder1089(Floyd最短路)

题目连接:点击打开链接解题思路:全源最短路完整代码:#include #include #include #include #include using namespace std;int n , m;const int maxn = 1111;const int INF = 1000000000;int d[maxn][maxn];void init

2015-04-09 20:45:39 656

原创 2000年清华大学计算机研究生机试真题

题目连接:点击打开链接解题思路:不可以用cin,会超时完整代码:#include #include #include #include #include using namespace std;const int INF = 1000000000;const int maxn = 10001; char s[maxn];int main(){ #i

2015-04-05 14:53:31 752

原创 2012年哈尔滨工业大学计算机研究生机试真题

题目连接:点击打开链接解题思路:模拟完整代码:#include #include #include #include #include using namespace std;const int INF = 1000000000;const int maxn = 10001; char a[maxn] , b[maxn];void MyStrcat(ch

2015-04-05 14:28:17 1290

原创 2011年哈尔滨工业大学计算机研究生机试真题

题目连接:点击打开链接解题思路:暴力完整代码:#include #include #include #include #include using namespace std;const int INF = 1000000000;string s;int main(){ #ifdef DoubleQ freopen("in.txt" , "

2015-04-05 12:38:59 915

原创 2010年哈尔滨工业大学计算机研究生机试真题

题目连接:点击打开链接解题思路:简单暴力完整代码:#include #include #include #include #include using namespace std;int n;int a[300]; bool check(int key){ set s; s.clear(); for(int i = 1 ; i <

2015-04-05 12:26:45 987

原创 哈理工热身赛

2238.题目连接:点击打开链接解题思路:并查集判断下是否成环即可完整代码:#include #include #include using namespace std;int n , m;bool flag;const int maxn = 10001;int f[maxn];void init(){ for(int i = 0 ;

2015-04-05 10:18:06 665

原创 hihocoder1081(Floyd全源最短路)

题目连接:点击打开链接解题思路:全源最短路Floyd算法,初始化时对角线为0,其余位置为无穷远。完整代码:#include #include #include #include using namespace std;int n , m;const int maxn = 1111;int g[maxn][maxn];const int INF = 1

2015-04-04 10:36:42 757

原创 操作系统:模拟进程及内存分配

完整代码:#include #include #include #include using namespace std;struct empt // Define the empty table{ int start; int len;};list emptable;bool cmp(struct empt a , struct empt b){

2015-04-02 21:36:00 711

原创 hihocoder1038(01背包)

题目连接:点击打开链接解题思路:典型的01背包,非常省空间的一种写法。完整代码:#include #include #include #include using namespace std;const int maxn = 111001;int n , m;int need[maxn] , val[maxn] , dp[maxn];int mai

2015-04-02 21:33:50 1321

原创 hihocoder1037(记忆化搜索)

题目连接:点击打开链接解题思路:和白书上的数字三角形一样,用记忆化搜索解决,推出转移方程dp[i][j] = g[i][j] + max( d( i + 1 , j ) , d( i + 1 , j + 1) );完整代码:#include #include #include #include using namespace std;const int m

2015-04-02 21:06:20 746

贪吃蛇 源码

适合C++初学者,实现简单的贪吃蛇游戏。里面都是源码,很容易看懂

2014-04-06

空空如也

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

TA关注的人

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