原创 BFS 2470. Robot in Maze

There is a robot trapped in the maze. Now you have to send out some instructions, telling it how to reach its destinati

原创 scanf()如何讀取一整行(轉)

用scanf獲取一行字符串包括空格的以及C語言函數 其內容爲 #include<stdio.h> int main() {       char str[1024];       scanf("%[^\n]", &str);     

原创 BFS 3517. The longest athletic track

解題思路: 先隨便確定一個頂點,則從該頂點廣搜到的最遠的點一定是該圖的一個起始點,則再從該點出發,廣搜。 After a long time of algorithm training, we want to hold a runni

原创 BFS 3071. Number Game

There is an interesting game. We start with a number K. Then three operati

原创 BFS 1132. Knight Moves

在做這道題之前,居然不知道下棋是走“日”字形的,所以查了半天,汗。。。。 總共有八個方向,屬於比較簡單的廣搜 A friend of you is doing research on the Traveling Knight Prob

原创 ACM2014選拔 4076. Words Count

This task is very simply, give you an article, you should just output how many words there are. The words may be split

原创 2894. Meetings

There are several meeting rooms in Tianjin University. Since there are a lot of new students registering at the begin

原创 Max Sum

Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence.

原创 3856. Rob

10 years ago, the students in Ant's primary school were often robbed by a bad guy on their way back home after school.

原创 網頁開發Myeclipse+MySQL流程

1、  數據庫設計 建立crud.student數據庫表: 圖1 數據庫表 你可以使用如下語句創建該庫表: [sql] view plaincopy create database if n

原创 2647. Printer Queue

The only printer in the computer science students' union is experiencing an extremely heavy workload. Sometimes there

原创 1908. Automatic Editing

Text-processing tools like awk and sed allow you to automatically perform a sequence of editing operations based on a

原创 2547. Subsequence

終於知道錯哪兒了。。。。 剛開始用for循環,對於每個i,從i開始,加每個元素,如果大於等於sum,則記錄長度與l比較,想了好久,覺得這種最原始的方法沒有錯,但是後來發現: 如果從某個起點開始加,加到大於等於s的數後,若這個子序列的前端有

原创 Number Sequence

Problem Description A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mo

原创 1022. Packets

A factory produces products packed in square packets of the same height h and of the sizes 1x1, 2x2, 3x3, 4x4, 5x5, 6x6