原创 uva 11100- The Trip

11100 - The Trip, 2007 Time limit: 3.000 seconds  http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&

原创 hdu1004 -Let the Balloon Rise

Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, th

原创 hdu6011 -Lotus and Characters

Lotus and Characters Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/131072 K (Java/Others) Total Submis

原创 hdu2037 今年暑假不AC

Problem Description “今年暑假不AC?” “是的。” “那你幹什麼呢?” “看世界盃呀,笨蛋!” “@#$%^&*%...” 確實如此,世界盃來了,球迷的節日也來了,估計很多ACMer也會拋開電腦,奔向電視了。 作爲球

原创 HDU - 5914 A - Triangle

Triangle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1171 

原创 uva 1346 Songs

題目大意:John Doe 是一個著名的DJ,現在他有n首播放個曲, 每首歌曲有識別符key,歌曲長度l,以及播放頻率q。想在John Doe 想將磁帶上的歌曲重新排列,方便播放,播放所有歌曲有一個複雜度的計算∑(1≤i≤n)q[i]

原创 zoj 3210 A Stack or A Queue?

Description Do you know stack and queue? They're both important data structures. A stack is a "first in last out" (FI

原创 hdu5842-Lweb and String

Lweb and String Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s)

原创 poj1979 Red and Black

Red and Black Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 35903   Accepted: 19444 Description Ther

原创 順序表的基本操作

#include<iostream> #define TRUE 1 #define FALSE 0 #define OK

原创 PTA 排座位(25 分)

佈置宴席最微妙的事情,就是給前來參宴的各位賓客安排座位。無論如何,總不能把兩個死對頭排到同一張宴會桌旁!這個艱鉅任務現在就交給你,對任何一對客人,請編寫程序告訴主人他們是否能被安排同席。 輸入格式: 輸入第一行給出3個正整數:N(≤

原创 PTA 6-1 循環單鏈表區間刪除(15 分)

本題要求實現帶頭結點的循環單鏈表的創建和單鏈表的區間刪除。L是一個帶頭結點的循環單鏈表,函數ListCreate_CL用於創建一個循環單鏈表,函數ListDelete_CL用於刪除取值大於min小於max的鏈表元素。 函數接口定義:

原创 並查集模板

int find(int x) { int r = x; while(father[r]!=r) r = father[r]; return r; } /* int find(

原创 鏈表,順序表的逆置

帶頭結點的單鏈表逆置#include<stdio.h> #include<malloc.h> #include<stdlib.h> //函數狀態碼定義 #define TRUE 1 #define FALSE

原创 ADT 單鏈表

#include<iostream> #define TRUE 1 #define FALSE 0 #define OK