原创 數據結構練習 02-線性結構3 Reversing Linked List (25 分)

Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For exam

原创 數據結構練習 02-線性結構4 Pop Sequence (25 分)

Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You ar

原创 數據結構練習 02-線性結構2 一元多項式的乘法與加法運算 (20 分)

設計函數分別求兩個一元多項式的乘積與和。 輸入格式: 輸入分2行,每行分別先給出多項式非零項的個數,再以指數遞降方式輸入一個多項式非零項係數和指數(絕對值均爲不超過1000的整數)。數字間以空格分隔。 輸出格式: 輸出分2行,分別以指數遞

原创 數據結構練習 01-複雜度2 Maximum Subsequence Sum (25 分)

Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​

原创 數據結構課後練習 01-複雜度1 最大子列和問題 (20 分)

給定K個整數組成的序列{ N​1​​, N​2​​, ..., N​K​​ },“連續子列”被定義爲{ N​i​​, N​i+1​​, ..., N​j​​ },其中 1≤i≤j≤K。“最大子列和”則被定義爲所有連續子列元素的和中最大者。

原创 數據結構練習 01-複雜度3 二分查找 (20 分)

本題要求實現二分查找算法。 函數接口定義: Position BinarySearch( List L, ElementType X ); 其中List結構定義如下: typedef int Position; typedef st

原创 數據結構練習 02-線性結構1 兩個有序鏈表序列的合併 (15 分)

本題要求實現一個函數,將兩個鏈表表示的遞增整數序列合併爲一個非遞減的整數序列。 函數接口定義: List Merge( List L1, List L2 ); 其中List結構定義如下: typedef struct Node *P

原创 最短路Dijkstra——Til the Cows Come Home

Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes

原创 Codeforces——Hello 2019(待更新)

A. Gennady and a Card Game Gennady owns a small hotel in the countryside where he lives a peaceful life. He loves to ta

原创 Educational Codeforces Round 57 (Rated for Div. 2) (待更新)

A.Find Divisible You are given a range of positive integers from l to r . Find such a pair of integers (x,y) that l≤x,y

原创 最短路Dijkstra變形——Frogger

Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another sto