原创 hdu 3602 2012

變形的揹包。 #include <stdio.h> #include <string.h> #include <algorithm> using namespace std; int a[110], b[110]; int dp[110

原创 hdu 3954 Level up

操作十分不同,很特別 比賽的時候沒想出來,好好總結吧 點贊 收藏 分享 文章舉報 HQD因爲有趣所以做題 發佈了526 篇原創文章 · 獲贊 3 · 訪問量 75萬+

原创 hdu 3586 Information Disturbing 二分+樹狀DP

這種題目很容易看出二分,接着就是O(N)的驗證了 #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N =

原创 hdu 2809 God of War //狀態壓縮DP

用記憶話搜索的可能時間上稍微慢點。 /* 幾個陷阱吧 一個是可能出現攻擊比防禦小的情況,那麼取傷害爲1 另一種就是經驗不清零,題目沒提及吧 */ #include <stdio.h> #include <string.h> struct

原创 反思

聽了ZZC師兄的分析,還是感覺要反思一番 是否真的過於注重實現而沒有注重思維的轉化? 跟真正強隊的區別爲什麼永遠追不上? 訓練方法肯定有問題 做的題目也過於陳舊 反思吧。 點贊 收藏 分享

原创 hdu 3338 Kakuro Extension

最大獨立集 #include <cstdio> #include <cstring> int usedif[1005]; int link[1005]; int mat[1005][1005]; long long a[1010];

原创 HDU 4107

線段樹的題目 #include <cstdio> #define LL(x) x << 1 #define RR(x) x << 1 | 1 const int MAXN = 200000 + 123; struct NODE {

原创 Codeforces Beta Round #75 Igloo Skyscraper

很不錯的一道線段樹的題目 在每個節點裏面加個線性表,這是關鍵的操作! 線性表裏面是這個節點的範圍內,將它按照a數組從小到大排序,接着剔除掉a[i] >= a[j] 並且b[i] >= b[j]這種j 另外還要用到(a[x] - a

原创 線段樹整理

開始PHD生涯,好久不做題了,手生的不行,代碼能力、算法能力直線下滑。 不管以後我做什麼方向,做做題目能很好地鍛鍊我的思維,所以以後開始繼續做題,純粹爲了玩! 先整理一下線段樹方面的題目吧,最近項目有用到,還有一些新的線段樹的題目陸續添加

原创 快比賽了啊

開始整理整理一些很偏的算法。。。開始整理整理吧 博客越來越懶得更新了,寫的題也懶得放了。。。。。。

原创 最小樹形圖

poj 3164  Command Network #include<cstring> #include<cstdio> #include<cmath> #include<algorithm> using namespace std;

原创 hdu 3442 Three Kingdoms

狀態壓縮+BFS //記憶話搜索 #include <cstdio> #include <cstring> #include <queue> using namespace std; char map[55][55]; int mp[

原创 hdu 4008 Parent and son

/* 首先以1爲根,掃描一遍樹,得到每個節點的minchild[i][2],兒子節點的最小值和次小值(不同子樹的) 和每個節點的最小後綴的值mindown[i] (1)如果x是y的父節點的話,那麼直接輸出mindown[i],minc

原创 hdu 3987 Harry Potter and the Forbidden Forest//邊數最小的最小割 2種解題方法

每條邊的權值改爲w*(M+1)+1 最後得到的和sum sum div (M+1)  得到的是最小割的值,用(M+1)是爲了不被後面的1影響到 sum mod (M+1)得到的是最小割的邊數,這個是在上面的最小割前提下求出來的(YY一下

原创 poj 1222 EXTENDED LIGHTS OUT //高斯消元

整理一下這塊而已 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<stdlib.h> using namespace std;