原创 最長01串(OJ--3308

題目描述 給定一個0-1串,請找到一個儘可能長的連續子串,其中包含的0與1的個數相等。 組數很多,注意常數優化。。。 輸入  一個字符串,只包含01,長度不超過1000000 輸出   一行一個整數,最

原创 EXTENDED LIGHTS OUT【高斯消元】

Description In an extended version of the game Lights Out, is a puzzle with 5 rows of 6 buttons each (the actual puzzl

原创 數據結構實驗之二叉樹五:層序遍歷

題目描述 已知一個按先序輸入的字符序列,如abd,,eg,,,cf,,,(其中,表示空結點)。請建立二叉樹並求二叉樹的層次遍歷序列。 輸入  輸入數據有多行,第一行是一個整數t (t<1000),代表有t行測試數據。每行是一個長度小於

原创 The Pilots Brothers' refrigerator 【POJ--2965】

Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a r

原创 數據結構實驗之圖論四:迷宮探索 【基於鄰接表的廣度優先搜索】

題目描述 有一個地下迷宮,它的通道都是直的,而通道所有交叉點(包括通道的端點)上都有一盞燈和一個開關;請問如何從某 個起點開始在迷宮中點亮所有的燈並回到起點? 輸入 連續T組數據輸入,每組數據第一行給出三個正整數,分別表示地

原创 Elven Postman【HDU 5444】【長春網絡賽】

Problem Description Elves are very peculiar creatures. As we all know, they can live for a very long time and their m

原创 Flip Game【POJ--1753】【枚舉】【高斯消元】

Description Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One

原创 Safecracker【ZOJ - - 1403】

=== Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein safe behind a painting in the second-flo

原创 A Bug's Life 【POJ--2492】【帶權的並查集】

Description Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that

原创 Xenia and Bit Operations 【線段樹】

Description Xenia the beginner programmer has a sequence a, consisting of 2n non-negative integers: a1, a2, ..., a2

原创 Painter's Problem【高斯消元】

Description There is a square wall which is made of n*n small square bricks. Some bricks are white while some bricks ar

原创 數據結構實驗之棧六:下一較大值(二)【OJ-3333】【自己寫的封裝的棧代碼】

題目描述 對於包含n(1<=n<=100000)個整數的序列,對於序列中的每一元素,在序列中查找其位置之後第一個大於它的值,如果找到,輸出所找到的值,否則,輸出-1。 輸入 輸入有多組,第一行輸入t(1<=t<=10),表示輸入的組

原创 Hacking Cypher(CF--490C

Description Polycarpus participates in a competition for hacking into a new secure messenger. He's almost won. Havi

原创 Prime Query【ZOJ--3911】

Description You are given a simple task. Given a sequence A[i] with N numbers. You have to perform Q operations on the

原创 An easy problem【上海網絡賽-HDU-5475】

Problem Description One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on th