自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

穿着裤衩跳

蜕变的蝉蛹

  • 博客(66)
  • 资源 (3)
  • 问答 (1)
  • 收藏
  • 关注

原创 C#MyAccounting )课本P229~237页,还未完成

链接: http://pan.baidu.com/s/1jHDW310 密码: vhx6

2016-03-31 00:05:15 476

原创 hdoj2020/hdoj2021/hdoj2022/hdoj2023

//hdoj2020#include#include#includeusing namespace std;int a[100000];bool cmp(int i, int j) { return abs(i)>abs(j);} int main() { int n; while(scanf("%d", &n)!=EOF && n) { for(int i = 0; i

2016-03-30 19:44:15 658

原创 hdoj2019

//hdoj2019 #includeint main() { int n, m, x; while(scanf("%d%d", &n, &m)!=EOF && (n||m)) { bool flag = true; for(int i = 0; i < n; i++) { scanf("%d", &x); if(flag) { if(x >= m) {

2016-03-30 14:42:26 519

原创 hdoj2018母牛的故事{手算模拟,递推找规律}不可以小看模拟题,发现自己真的好笨好笨啊~

//hdoj2018#includeint sum[58];int main() { //a 1岁的牛数 b 2岁的牛数 c 3岁的牛数 d 4岁及4岁以上的牛数 int a = 0, b = 0, c = 0, d = 1;//第一年 a = 0; b = 0; c = 0; d = 1; sum[1] = 1; for(int i = 2; i <= 57; i++)

2016-03-30 14:20:30 524

原创 hdoj2015/hdoj2016/hdoj2017

//hdoj2015 #includeint main() { int n, m; while(scanf("%d%d", &n, &m)!=EOF) { int sum = 0; for(int i = 1; i <= n; i++) { sum += 2*i; if(i%m == 0) { printf(i>m?" %d":"%d", sum/m);

2016-03-30 12:20:56 1152

原创 JS函数实现基本计算器计算

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>Insert title here function checknum(){ var x = document.getElementById("name1");//操作数1 var y = docu

2016-03-29 22:51:33 2010 1

原创 浮点水题hdoj2014这题之前做了很多次错了很多次纪念一番~

#includeint main() { int n; double sum, x, _max, _min; while(scanf("%d", &n)!=EOF) { sum = 0; _max = -1; _min = 1e8; for(int i = 0; i < n; i++) { scanf("%lf", &x); sum += x; if(x > _m

2016-03-29 18:29:47 478

原创 hdoj2013-递归入门

//hdoj2013两种写法:第一种:入门递归第二种:直接for循环#includeint n;int tao(int cur, int sum) { if(cur == n) return 1; return 2*(tao(cur+1, sum)+1);}int main() { while(scanf("%d", &n)!=EOF) { printf("%d\n"

2016-03-29 17:49:13 423

原创 hdoj2008/hdoj2009/hdoj2010/hdoj2011/hdoj2012

//hdoj2008#includeint main() { int n, f, l, z; double m; while(scanf("%d", &n) && n) { f = l = z = 0; for(int i = 0; i < n; i++) { scanf("%lf", &m); if(m > 0) z++; else if(m < 0) f+

2016-03-28 13:35:04 1543

原创 水题 hdoj-2006奇数偶数判断小技巧 、 hdoj-2007

//判断n为奇数还是偶数,直接看(n&1)的值即可,为1则为奇数,为0则为偶数#includeint main() { int n, t; while(scanf("%d", &n)!=EOF) { long long ans = 1; for(int i = 0; i < n; i++) { scanf("%d", &t); if(t&1) ans *= t; }

2016-03-27 10:54:37 376

原创 水题hdoj-2005 scanf用好了事半功倍

我之前的写法:#include#includechar a[12];int main() { while(scanf("%s", a)!=EOF) { int len = strlen(a); int i, ansy = 0, ansm = 0, ansd = 0; for(i = 0; i < len && a[i]!= '/'; i++) { ansy = ans

2016-03-27 10:44:57 358

原创 水题hdoj-2000、hdoj-2002、hdoj-2003、hdoj-2004

//hdoj-2000#include#include#include#includeusing namespace std;char a[5];int main() { while(scanf("%s", a)!=EOF) { sort(a,a+3); for(int i = 0; i < 3; i++) printf(i!=2?"%c ":"%c", a[i]);

2016-03-26 22:20:10 899

原创 scanf || printf 格式 小总结

【printf】函数格式说明的一般形式:%[标识][输出最小宽度][.精度][长度][类型]标识:[-]左对齐,[+]输出符号,[#]在八进制和十六进制数前显示前导0、0x ,[空格]正数空格代替正号,负数用减号最小宽度:实际位数多于定义的宽度,按实际位数输出, 少于定义的宽度,就补空格 精度:[输出整数]表示至少输出数字个数,不足补0,多则原样输出        [输

2016-03-26 21:54:27 398

原创 hdoj-1072 --Nightmar||我仿照hdoj-1044的差不多的思路写的(DFS+BFS, 主要是看到了路可以来回走, 可能是数据比较弱, 0ms过了,看到网上好多都是BFS就直接过了)

NightmareTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9250    Accepted Submission(s): 4461Problem DescriptionIgnatius had a n

2016-03-25 17:51:59 404

原创 hdoj-1045-Fire Net

这题数据比较水, 直接暴力地挨个儿地判断每一个点,就可以过掉了。。。。。。。(看到有人用二分图什么的,我还不会....努力学习中`#include#include#include#include#includeusing namespace std;const int maxn = 5;char G[maxn][maxn];int h, ans;bool jg(int x

2016-03-24 17:47:44 314

原创 hdoj-1044 Collect More Jewels 这题对我来说有点难..

参考博客:http://www.xuebuyuan.com/2176887.html第一种方法:BFS+状态压缩#include#include#include#include#includeusing namespace std;const int maxn = 55;struct node{ int x, y; //坐标位置 int key; //用10位二进制来

2016-03-23 20:36:01 476

原创 归并排序求逆序对数

参考博客:归并排序求逆序对数#include#include#include#includeusing namespace std;//归并排序是借助一个辅助数组来进行排序 int ans = 0;void merge_sort(int *A, int l, int r, int *T) {//A是原数组,T是辅助数组 if(r-l>1){ int mid = (

2016-03-23 07:55:04 344

原创 hdoj--1043--八数码--bfs||A*(HASH判重--康托)

先看了一篇别人的题解, 虽然这个题解过不了OJ,内存超限, 但是里面用到一种思想挺好, 就是逆向BFS+康托展开,因为终点状态唯一, 所以, 将终点作为第一个状态点 ,放进队列, 然后开始逆向广搜,将每一个没有出现过的状态点都存起来, 然后后面每一次询问的时候,就不用再去搜了, 直接O(1)的查询, 这种思路还是很不错的。!!!下面是这个MLE代码, 虽然没有过, 但是还是很有借鉴价值的:

2016-03-19 14:52:22 894

原创 康托展开(方便排列计数)

康托展开讲解

2016-03-18 20:59:34 320

原创 hdoj-1026--Ignatius and the Princess I---BFS+优先队列(每次先用用时最少的点进行扩展)【A*】

我辛辛苦苦的花了两个小时写了个BFS, 结果WA了, 因为他说的是要求最短的时间内找到公主, 我没有考虑这个,所以错了。但是怎么说呢,我的BFS记录路径我以后就用这个格式了, 说实话dfs打印路径的时候我想了很久....WA代码(仅过了样例):#include#include#include#includeusing namespace std;const int maxn =

2016-03-18 13:33:09 592

原创 hdoj-1015-Safecracker--dfs--细心(剪枝要准确, 要么不剪枝, 别留下剪枝后遗症~)

这题居然一点都不卡我时间, 真是醉了啊~。。。。。。。。。。。。。。。刚开始还在想26个字母里面选出5个进行排序的情况有7893600种, 可能会卡我时间, 逗得我还去想办法各种剪枝(还因为这个在dfs里面加了个sum>N的错误判断以至于我一直找不到为什么第一个样例就错了而其他样例都对了的原因)。这题就是考察一下细心程度吧。思路:要求:按字典序选择字母规律:奇数都是加,偶数都是减

2016-03-17 19:30:41 334

原创 个人小笔记2016/3/17

判断当前整数cur的奇偶性,直接cur&1就可以快速判断了。

2016-03-17 18:50:04 401

原创 排列组合公式和写法

C(n, m) 和是一样的C(n, n-m)  , 还有C(n, 0)是1  , 这些是基本知识。

2016-03-17 16:50:10 4884 4

转载 关于===奇偶性剪枝====

关于奇偶剪枝首先举个例子,有如下4*4的迷宫,'.'为可走路段,'X'为障碍不可通过S..............D从S到D的最短距离为两点横坐标差的绝对值+两点纵坐标差的绝对值 = abs(Sx - Dx) + abs(Sy - Dy) = 6,这个应该是显而易见的。遇到有障碍的时候呢S.XXX.XX...X..

2016-03-17 12:49:35 600

原创 hdoj--1010 ---Tempter of the Bone (dfs + 一些剪枝(擦边AC了), 居然又犯了老毛病, 我没有用奇偶性剪枝)

刚开始一看数据范围T是50感觉深搜肯定不行, 以为使用广搜的, 后来写到后面发现, 对于刚好在T时间到达门, 这一点没办法做到, 所以只有用深搜高度剪枝了。。。这题考的是奇偶性剪枝, 但是我不会, 准备去学一下, 现在暂时用这几个普通剪枝擦边AC了。#include#include#includeusing namespace std;const int maxn = 10;char G

2016-03-17 08:02:12 411 2

原创 筛法图

2016-03-15 13:32:42 222

原创 hdoj_5643 King's Game(约瑟夫环问题变种)----超时版本(自己模拟的循环链表)

我很搞笑的用C++写了个C版本的双向循环链表(虽然是超时的,但是很久没有写过链表的,所以试一试)。。。#include#include#include#includeusing namespace std;struct node { int num; struct node * pre, * next;};struct node * create(struct n

2016-03-14 20:21:58 742

原创 多个数的最小公倍数求法

例如求a b c 得最小公倍数就是e = lcm(a, b),  f  =  lcm(b, c)   先求出来然后再求lcm(e, f);就是他们的最小公倍数

2016-03-14 07:46:18 852

原创 hdoj5640_每次(只用一刀)切一个正方形蛋糕,用除法更快!

#include#include#includeusing namespace std;int T, n, m, temp, cnt;int main() { cin >> T; while(T--) { cnt = 0; cin >> n >> m; while(n != m) { if(n > m) { //用除法更省时 temp = n/m;

2016-03-13 20:49:22 693

原创 hdoj5641模拟。。。真的很要细心

#include#include#includeusing namespace std;int T, k, x, flag, last, vis[1000];int main() { cin >> T; while(T--) { flag = 1; memset(vis, 0, sizeof(vis)); scanf("%d", &k); if(k 9) flag

2016-03-13 20:09:52 374

原创 hdoj_5642 (动规---------他们说这题思想是数位dp,然而我看了一天半数位dp还是没弄懂。。。)

#include#include#include#define LL long long #define MOD 1000000007using namespace std;const int maxn = 2000+10;int N;LL p[maxn][5];int main() { int T; cin >> T; while(T--) { memset(p, 0

2016-03-13 17:52:28 399

原创 个人小笔记16.3.12

排列:分为奇排列和偶排列、一个排列中逆序数为奇数  ==》 奇排列一个排列中逆序数为偶数  ==》 偶排列eg:针对 1 2 3偶排列:123,231,312.奇排列:213,132,321.-----------------------------------常常看见~scanf(..)的用法, ~是取反的意思,假如scanf没有读取到内容,返回值就是-1,也就是

2016-03-12 15:39:37 316

原创 前缀异或:XOR Segment (用的是前缀和的思想,所以暂且称这个方法为前缀异或)

XOR Segment Time Limit : 3000/1000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 34   Accepted Submission(s) : 12Font: Times New Roman | Verdana | Georgia Font

2016-03-12 13:42:09 4222

原创 前缀和:区间和

区间和 Time Limit : 3000/1000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 76   Accepted Submission(s) : 29Font: Times New Roman | Verdana | Georgia Font Size: ←

2016-03-12 11:29:20 3975

原创 (隐式图)八数码问题(三种判重方法:排列计数、哈希技术、STL_set判重)

#include#include#include#includeusing namespace std;typedef int State[9];const int maxstate = 1000000;State st[maxstate], goal; //这个st数组就像一个队列 有front队首和rear队尾 int dist[maxstate];const int

2016-03-10 20:49:50 1356 1

原创 高斯消元法(普通列主元消元法)模板 ==》 还需要优化

#include#include#include#includeusing namespace std;const int maxn = 220;typedef double Matrix[maxn][maxn];void swap(int a, int b) { int temp = a; a = b; b = temp;}void Print(Matrix A, i

2016-03-09 21:01:06 822

转载 高斯消元法理解关灯问题

高斯消元法处理关灯问题

2016-03-09 14:40:41 1333

原创 高斯消元法求矩阵系数

/*2 3 4-3 3 1*/#include#include#includeusing namespace std;const int maxn = 1000; typedef double Matrix[maxn][maxn];void gauss_elimination(Matrix A, int n) { int i, j, k, r; for(i = 0; i

2016-03-08 16:42:43 875

原创 Tsinsen-A1105===数据很弱, 我用dfs(打印路径+发现自身的毛病)过了, 这题输入部分比较有趣。。。

#include#include#includeusing namespace std;const int maxn = 50;int N;int a[maxn][maxn]; //每个点的地雷数目 int path[maxn];int temp[maxn];int vis[maxn];int w[maxn];int Big, deep;void Update() {

2016-03-08 00:20:47 275

原创 POJ2488==DFS+路径输出+字典序排列

/* * POJ 2488 * DFS进行遍历就好,记录走过的路径,只要不重复地走过p*q个方格就行了(结束条件) */* 这里注意几个问题: 1、国际象棋,横着是字母,竖着是数字。 2、是按字典序输出的,所以搜索方向上一定要注意!这里是个坑。 3、忽略“The knight can start and end on any square of the board.”这句话,

2016-03-07 12:10:02 554

rxtx-2.1-7r2.zip

用于Java串口通信的工具类RXRX,内含安装说明,Eclipse使用说明等。

2018-01-03

原官方javacomm20-win32.rar

原官方javacomm-win32.zip工具类,包含jar包以及,全部对应的API。 注意:此jar包是用在windows系统的! 简述:其为SUN在1998年发布的串口通信API:comm2.0.jar(Windows下)、

2018-01-02

Dev-Cpp 5.9.1 TDM-GCC 4.8.1 最新版

Dev-Cpp 5.9.1 TDM-GCC 4.8.1 最新版 修改了一些BUG, 确实好用了很多, 关键是比之前要稳定!!!

2016-03-13

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

TA关注的人

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