自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Mr. WA's Blog

Do you know WA?It's "WRONG ANSWER"!

  • 博客(26)
  • 资源 (3)
  • 收藏
  • 关注

原创 HDU-2688 线段树

入门题目。。。/* * hdu-2688 rotate * mike-w * 2011-11-30 * ---------------------- * tag: * 数状数组 * ps: * 讲述一下我做这道题的悲惨遭遇: * 1. 提交别人的代码,发现都是TLE... * 2. 看别人风格糟糕的代码时被忽悠了: :??::?? <-为啥不if-then?! * 3.

2011-11-30 20:29:21 1026

原创 HDU-1394 求逆序对数

参考题解之后,AC!算是NOIP2011后的线段树第一题!逆序对数——经典问题吧。逆序对数有一个性质,见DISCUSS。统计某一个区间的元素个数,当然线段树!/* * hdu-1394 minimum inversion number * mike-w * 2011-11-25 * --------------------------------- * reckon

2011-11-28 19:32:46 807 1

原创 POJ-3264 RMQ

NOIP2011 2=收场,悲剧。“长风破浪会有时,直挂云帆济沧海”AC 3000+ms/** ** poj-3264 balanced lineup ** mike-w ** 2011-11-21 ** tag: RMQ **/#include#include#include#define LIST_SIZE 100000#define MAX_EXP 100#

2011-11-21 19:56:33 428

原创 hdu-2112 最短路 SPFA

没怎么测试,结果贡献WA若干。期待NOIP成绩,但愿1=/* * hdu-2112 hdu today * mike-w * 2011-11-13 * ------------- * shortest path */#include#include#include#define MAXV 20000#define MAXE 20000#define LEN 200

2011-11-13 15:00:34 484

原创 hdu-1874 SPFA

noip day1 少得100分,看错题了。。。/* * hdu-1874 SPFA * mike-w * 2011-11-12 */#include#include#include#define MAXN 500#define MAXM 5000#define QSIZE 5000#define INF 999999typedef struct _lnode{

2011-11-12 18:38:27 607

原创 hdu-1598 并查集+贪心

可能是太热了,效率低,GDBing很长时间,并贡献WA一个。 /* * hdu-1598 * mike-w * 2011-11-10 */#include#include#include#define MAXM 1024#define MAXN 256#define INF 999999typedef struct _edge{ int start,end,we

2011-11-10 22:37:54 889

原创 hdu-1106 排序

水题一道。。。注意细节。。。/* * hdu-1106 * mike-w * 2011-11-10 */#include#include#include#define SIZE 2000char buf[SIZE];__int64 f[SIZE];int comp(const void* e1,const void *e2){ return *((__int64*

2011-11-10 21:27:14 445

原创 tyvj-1196 DFS

数据WATER~~~~/* * tyvj-1196 * mike-w * 2011-11-9 */#include#include#include#include#define SIZE 22#define INF 99999999float p[SIZE][2];float dist[SIZE][SIZE];double ans=INF;int tag[SIZE

2011-11-09 20:40:54 451

原创 hdu-1166 线段树

先前写过一个,今天对线段树有新理解——闭区间代替半开半闭区间15ms的程序是怎么写的??/* * hdu-1166 敌兵布阵 * mike-w * 2011-11-8 */#include#include#include#define MAXN 50505#define TSIZE 10000000typedef struct _tnode{ int l,r,

2011-11-09 20:08:44 407

原创 tyvj-1188 添加括号 DP 输出方案

DP简单,输出方案不是十分容易。一次AC,嘻嘻..../* * tyvj-1188 * mike-w * 2011-11-8 */#include#include#include#define min(a,b) ((a)<(b)?(a):(b))#define SIZE 20#define INF 9999999int N;int f[SIZE][SIZE];i

2011-11-09 15:08:32 642

原创 tyvj-1144 股票 DP

没明白。。。#include#include#include#define max(a,b) ((a)>(b)?(a):(b))double f,g,v;long N,i;int main(void){#ifndef ONLINE_JUDGE freopen("in","r",stdin);#endif scanf("%ld",&N); f=1.0; scanf(

2011-11-09 13:53:54 509

原创 tyvj-1052 能量项链

环状DP,可以记忆化,亦可以递推。/* * tyvj-1056 * mike-w * 2011-11-8 */#include#include#include#define max(a,b) ((a)>(b)?(a):(b))#define SIZE 500int f[SIZE];int opt[SIZE][SIZE];int N;int main(void){

2011-11-09 10:12:32 718

原创 tyvj-1055 区间DP

区间DP,石子合并的简化版/* * tyvj-1055 * mike-w * 2011-11-8 * ------------- * 区间DP */#include#include#include#define SIZE 333#define INF 9999999int N;int f[SIZE],g[SIZE][SIZE];int opt[SIZE][SIZE

2011-11-08 23:22:10 413

原创 tyvj-1052 树形DP

树形DP,从字面上看,就是在树上DP。DP要有拓扑关系,在树上找拓扑关系,太麻烦,所以记忆化搜索实现。有3种决策:PARENT GO & SON STAYPARENT STAY & SON ? (?=GO/STAY) /* * tyvj-1052 * mike-w * 2011-11-8 * ------------ * 树形DP首题 */#include#in

2011-11-08 23:05:02 605

原创 SPFA首题!hdu-2544

刚才看了一下SPFA,很简单。时间有限,见BAIDU。说是BELLMAN的优化,不过我觉得更像DIJKSTRA#include#include#include#define SIZE 200#define QSIZE 200#define INF 9999999int f[SIZE][SIZE];int d[SIZE];int inq[SIZE];int que[QSIZE]

2011-11-07 22:46:08 351

原创 tyvj-1050 LCS DP

刚开始写的竟然WA,至今不知原因.../* * s.c */#include#include#include#define SIZE 1010#define QSIZE 10000typedef struct _node{ int x; int y;}node;int T,R,C;char f[SIZE][SIZE];int g[SIZE][SIZE];no

2011-11-07 19:48:45 416

原创 tyvj-1048 DP

还是经典问题,权当复习。/* * tyvj-1047 * mike-w * 2011-11-6 * -------------- * 和1045类似 * -------------- * DP经典问题 * -------------- * 扫了一眼DISCUSS * 不用高精度 :) */#include#include#include#define max(a,

2011-11-06 20:21:16 381

原创 tyvj-1045 DP

DP就是划分子问题,解决子问题而后从子问题的解得到整个问题的解。其实就是分治。/* * tyvj-1045 * mike-w * 2011-11-6 */#include#include#include#define max(a,b) ((a)>(b)?(a):(b))#define SIZE 20int num[SIZE];int sum[SIZE][SIZE];i

2011-11-06 20:02:42 450

原创 tyvj-1044 DP

经典问题。/* * TYVJ-1044 数字三角形 * mike-w * 2011-11-6 * ------------------ * DP * ------------------- * build confidence... */#include#include#include#define max(a,b) ((a)>(b)?(a):(b))#define

2011-11-06 18:46:08 459

原创 tyvj-1034 DP

继续刷TYVJ上的DP!!!CHEER UP!距NOIP2011还一周.../* * tyvj-1034 nick的任务 * mike-w * 2011-11-6 * ------------------ * 贡献WA若干,目前还未AC * ----------------- * 偶然得知TYVJ也可以#ifdef ONLINE_JUDGE * ------------

2011-11-06 18:37:55 612

原创 POJ-1384 完全背包

没啥好说的,做过一遍==|||/* * POJ * mike-w * 2011-11-4 * ---------------- * 背包问题 * ---------------- * 这题我貌似做过一遍 */#include#include#include#define SIZE 10101#define INF 9999999int T,E,F,N,W,P,C;i

2011-11-04 23:19:48 510

原创 POJ-2626 DP

最近老有低级错误出现。。。状态不佳。。。/* * POJ-2626 chess * mike-w * 2011-11-4 * ------------------ * tag: DP * ------------------ * f[n][i][j]: 前n个人中选i个white,j个black的最优值 * ------------------ * 最近怎么老犯低级错误?!

2011-11-04 22:56:56 574

原创 tyvj-1006 模拟

对付小数据,就是KISS!#include#include#include#define FILE_INPUTint main(void){ char s[20]; int sum,remainder;#ifdef FILE_INPUT freopen("in","r",stdin);#endif scanf("%s",s); sum=(s[0]-'0')+ 2*

2011-11-02 21:58:16 383

原创 tyvj-1017 并查集

裸并查集。#include#include#include#define SIZE 1111#define FILE_INPUTint set[SIZE];int init(int size){ int i; for(i=0;i<=size;i++) set[i]=-1; return 0;}int find(int e){ int node=e,root

2011-11-02 21:45:53 473

原创 TYVJ-1031 最短路

简单最短路,没有二叉堆优化。/* * TYVJ-1031 热浪 * mike-w * 2011-11-1 * ---------------- * 最短路 */#include#include#include#define SIZE 2555#define INF 99999#define FILE_INPUTint f[SIZE][SIZE];int d[SIZ

2011-11-01 21:03:00 689

原创 HDU-3729 二分图匹配

简单处理之后二分图匹配。明天期中考试,CHEER UP!/* * hdu-3729 i'm telling the truth * mike-w * 2011-11-1 * ------------------------------ * 二分图 */#include#include#include#define SIZE 100typedef struct _li

2011-11-01 19:50:28 721

空空如也

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

TA关注的人

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