自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 poj 1007

题目链接m

2014-04-08 14:08:43 355

原创 uva 12294 - RPG battles

链接dp有w1就加两个状态 能量1-100  w2 1-7  (2^7已近超过100了)#include#include#includeusing namespace std;#define INF 99999999#define MIN(a,b) (a>b?b:a)double dp[2][105][15];int mm[8];void clear(int

2014-03-29 15:22:59 911

原创 UVA 12295 Optimal Symmetric Paths

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3716题目给我们求在n*n的格子图  每个格子有一个值 要求求出从左上角(1,1)到右下角(n,n)花费最小(等于cost min)有几种走法 要求路径必须对称于斜对角线 一个点最多走一次 可以上下左右随

2014-03-29 14:38:31 471

原创 zoj 2256 Mincost

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2256n*2.5 n*2.5 > 10+(n-4)*2     8>=n>=5每8km一判断 就那就%8 判断余数前8km特判注意小数点的要求#include#include#include#include#include#inclu

2014-03-29 13:56:52 455

原创 zoj 3490 String Successor

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4313挺烦的题。代码太乱自己都看不懂#include#include#includeusing namespace std;string a;string ff[5];int n;bool f[10005];int judge(char c){ if

2014-03-29 13:47:36 539

原创 zoj 1745 Tree Recovery

由二叉数前序和中序确定后序http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1944对于字符串的下标处理真烦啊#include#include#include#includeusing namespace std;char a[30],b[30];int len;int find(char c){ f

2014-03-29 13:44:12 442

原创 uva 12293 Box Game

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3714博弈我不大懂但是看出规律了#include#include#include#includeusing namespace std;string str;int a[32];int

2014-03-25 00:47:12 699

原创 uva12299 RMQ with Shifts

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3720采用notonlysuccess的风格 博客链接:http://www.notonlysuccess.com/index.php/segment-tree-complete/单点更新刚开始我

2014-03-25 00:25:36 479

原创 poj2082

http://poj.org/problem?id=2082题意蛮难懂的 其实和poj2559(有图示)一样的碰到很多次了..#include#define MAX(a,b) (a>b?a:b)struct { int w,h;}a[50005];struct{ int pos,len;}l[50005],r[50005];int n;void solv

2014-03-24 13:17:49 706

原创 Codeforces Round #235 (Div. 2) D. Roman and Numbers

http://codeforces.com/problemset/problem/401/D给一段数字串和m 求数字除以m余0 的组合数状态压缩dp#include#include#includeusing namespace std;typedef long long LL;char str[20];LL dp[1<<18][100];LL mu[20];

2014-03-23 23:42:16 561

原创 Codeforces Round #237 (Div. 2) D Minesweeper 1D

http://codeforces.com/problemset/problem/404/D扫雷 给一串字符串  ?表示未知  1表示周边有一个(左或右)   2表示周边有二个 *表示此位置为类  求有几种放置方法    答案%1000000007递推len = 字符串最后下标a[i].z表示 i位置放0的方案a[i].of       i位置放1 并左边放一个雷的方案数

2014-03-23 20:10:01 473

原创 Codeforces Round #238 (Div. 2)

C. Unusual Producthttp://codeforces.com/problemset/problem/405/C对一个矩阵操作 输入1 后面接着的这个数是改变的行号 输入2 后面接着的这个数是改变的列号 输入3 输出矩阵计算的结果改变就是将整行或列 的每个数^1(取反)  计算就是求行乘列的和 如:1 1 10 1 1    =   (1·1 + 1·0 + 1

2014-03-23 13:05:42 506

原创 zoj 2127 lcis

注释的是我自己写的记录路径 WA  想不通#include#include#include#include#include#includeusing namespace std;#define MAX(a,b) (a>b?a:b)typedef long long LL;int dp[555][555];int a[555],b[555];int n,m;

2014-03-20 20:33:42 398

原创 hdu3779 Railroad 记忆化搜索

记忆化搜索...没其他说的了#include#include#define N 1005 //数据好像稍微超了点 1001就WA了 多留点空间是个好习惯 可惜我没有int hash[N][N];int a[N],b[N],c[2*N];int n,m;int dfs(int a_pos,int b_pos,int c_pos){ if(a_pos>n

2014-02-24 23:30:10 770

原创 nbut 1545 New Year 2014 数位dp

很裸的数位dp....按习惯用了预处理,代码很长但是看看人家用记忆化搜索写的如此简单,也试着写了下写的真是搓........各种特判....预处理:#includeusing namespace std;typedef long long LL;LL dp[19][16];int bit[19];int len;void init(){ for(int

2014-02-24 15:49:34 463

原创 spoj 1433. The Sum 数位统计

高逸涵的论文《数位计数问题解法研究》第一个例题  讲解的很详细 也是数位统计的入门训练吧题意:输入一个数N 输出从1到N每个数的每位(十进制)以+ - 循环处理的和For example, if N=12 then+1 -2 +3 -4 +5 -6 +7 -8 +9 -1+0 -1+1 -1+2 = 5按论文的的想法分奇偶进行统计即可#includeusing namespac

2014-02-23 14:46:21 523

原创 spoj 1182 Sorted bit squence 数位统计

刘聪的论文>中第三例这篇文章上思路已经分析的非常清楚了,只不过没给出具体代码,不过我还是花了很久才写出来......原题:http://www.spoj.com/problems/SORTBIT/题意:所有的数按照二进制中含1的个数从小到大排序,若个数相同按数的大小排,然后给我们一个区间(m,n)  求区间(m,n)中第k大的数并输出 (负数以补码的形式表示)

2014-02-23 12:41:06 651

空空如也

空空如也

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

TA关注的人

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