原创 01揹包 HDU - 2955 小偷搶銀行

The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the

原创 寧波市第31屆中小學程序設計比賽模擬試題 chicken

[提交][狀態][討論版] 題目描述 小 x 非常喜歡小雞翅。他得知 NSC 超市爲了吸引顧客,舉行了如下的活動: 一旦有顧客在其他超市找到更便宜的小雞翅,NSC 超市將免費送給顧客 1000g 小雞翅。小 x 爲了儘可能的省錢,走遍了各

原创 01揹包+完全揹包 HDU - 5410 

Today is CRB's birthday. His mom decided to buy many presents for her lovely son. She went to the nearest shop with M

原创 【搜索】泡泡龍 DFS

題目描述 這是一個簡化版的網絡遊戲:在一個N×N方塊構成的棋盤中,每個方塊均塗上紅、黃、藍、綠(記爲l、2、3、4)中的一種顏色,遊戲者可以在最底行任意找一個方塊,用鼠標雙擊這個方塊,於是該方塊及與之相鄰(即在上、下、左、右四個方向上有公

原创 數據結構 棧 無括號算術表達式處理算法 C語言版

#include "seqstack.h" #include "stdio.h" #include <conio.h> char ch; int ExpEvaluation()/*讀入一個簡單算術表達式並計算 其值。operatsign和

原创 完全揹包 POJ - 2063 

John never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had

原创 完全揹包基礎 HDU - 1114 

Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income fo

原创 數據結構 棧的建立及入棧出棧操作 C語言版

//鏈棧的建立及其出棧入棧操作 #include <cstdio> #include <stdlib.h> typedef int StackElementType ; typedef struct SNode {     StackEl

原创 寧波市第31屆中小學程序設計比賽模擬試題 【動態規劃】cirs

題目描述 Czyzoiers 都想知道小 x 爲什麼對雞蛋餅情有獨鍾。經過一番逼問,小 x 道出了實情:因爲他喜歡圓。最近小 x 又發現了一個關於圓的有趣的問題:在圓上有2N 個不同的點,小 x 想用 N 條線段把這些點連接起來(每個點只

原创 寧波市第32屆中小學生程序設計競賽(初中組) 母雞下蛋

問題 C: 母雞下蛋 雞國中的母雞最擅長下蛋了,MGMG 是雞國中一隻以下蛋產量高而聞名全雞國的母雞。 雞國專供下蛋的 n 個雞窩呈一字排列在雞國的“下蛋中心”,從左到右依次編號爲 1 到n。每個雞窩都有一個最大可下蛋的量,其中第 i

原创 Thrall’s Dream BFS 實現圖之間的訪問性

We never paid any heed to the ancient prophecies, like fools we clung to the old hatreds, and fought as we had for gen

原创 蒸包子湊數 完全揹包 藍橋杯

標題:包子湊數 小明幾乎每天早晨都會在一家包子鋪吃早餐。他發現這家包子鋪有N種蒸籠,其中第i種蒸籠恰好能放Ai個包子。每種蒸籠都有非常多籠,可以認爲是無限籠。 每當有顧客想買X個包子,賣包子的大叔就會迅速選出若干籠包子來,使得這若干籠中恰

原创 A^X mod P 大冪分解求和 打表

It's easy for ACMer to calculate A^X mod P. Now given seven integers n, A, K, a, b, m, P, and a function f(x) which de

原创 棧 括號匹配

#include <cstdio> #include <stdlib.h> #define Stack_size 100 typedef char ElemType; typedef struct Node {     ElemType

原创 Dollar Dayz POJ - 3181 動態規劃 完全揹包

Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first