*博客头图：

RGB颜色，例如：#AFAFAF

Hover：

RGB颜色，例如：#AFAFAF

RGB颜色，例如：#AFAFAF

# Defepe

• 博客(37)
• 资源 (1)
• 收藏
• 关注

#### 原创 POJ 2387 Til the Cows Come Home （dijkstra求最短路径）

Til the Cows Come HomeBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get back as quickly as possibleFarme

2020-07-16 22:46:07 18

#### 原创 HDU 1008 Elevator（模拟）

ElevatorThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4

2020-07-12 22:31:28 28

#### 原创 HDU 1005 Number Sequence（周期性循环 AC题目）

Number SequenceA number sequence is defined as followsf(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7Given A, B, and n, you are to calculate the value of f(n).InputThe input consists of multiple test cases. Each test case contains 3

2020-07-12 20:18:12 51

#### 原创 HDU 1001 Sum Problem （累加和）

Sum ProblemHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge)In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + … + n.InputThe input will consist of a series of integers n, one integer per line.OutputFor each case, output

2020-07-12 18:58:11 57

#### 原创 HDU 1753 大明A+B（进阶版大整数加法）

2020-07-12 11:01:06 47

#### 原创 计蒜客 T1389 检验身份证（题解）

2020-07-11 22:22:32 94

#### 原创 HDU 1282 回文数猜想（题解）

2020-07-11 21:07:08 41

#### 原创 POJ 3438 Look and Say （字符串）

Look and SayThe look and say sequence is defined as follows. Start with any string of digits as the first element in the sequence. Each subsequent element is defined from the previous one by “verbally” describing the previous element. For example, the st

2020-07-11 16:53:09 25

#### 原创 UVA 119 Greedy Gift Givers （简单题）

Greedy Gift GiversThis problem involves determining, for a group of gift-giving friends, how much more each person givesthan they receive (and vice versa for those that view gift-giving with cynicism).In this problem each person sets aside some money f

2020-07-11 15:57:28 37

#### 原创 HDU 1004 Let the Balloon Rise （map的使用，STL）

Let the Balloon RiseContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and

2020-07-11 09:55:20 31

#### 原创 HDU 2714 ISBN （有点小坑）

ISBNFarmer John’s cows enjoy reading books, and FJ has discovered that his cows produce more milk when they read books of a somewhat intellectual nature. He decides to update the barn library to replace all of the cheap romance novels with textbooks on a

2020-07-10 22:27:23 50

#### 原创 FZU 1056 扫雷游戏（模拟题）

2020-07-10 19:28:42 46

#### 原创 POJ 2251 Dungeon Master（BFS 广度优先搜索）

Dungeon MasterYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or down. You cannot mov

2020-07-10 16:18:41 25

#### 原创 POJ 1321棋盘问题 （dfs）

2020-07-10 08:39:27 53

#### 原创 PAT (Advanced Level) Practice 1009 Product of Polynomials（暴力循环）

2020-07-09 20:46:26 19

#### 原创 PAT (Advanced Level) Practice 1008 Elevator（模拟题）

ElevatorThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4

2020-07-09 16:53:14 41

#### 原创 PAT (Advanced Level) Practice 1007 Maximum Subsequence Sum（极短代码，O(n) 解决）

1007 Maximum Subsequence Sum题意： 求一串数字的最大连续和，并且输出最左端的数字和最右端的数字。这个题可以用一个for循环解决，时间复杂度O(n)。主要是先设置两个端点i，j，i为左端点，j为右端点。如图所示：-101234-5-2337-21i 和 j 开始都从数组下标0开始，然后用sum += a[ j ]；如果发现sum < 0，i = j + 1， 继续循环（每次循环 j++），（因为sum > 0，不管怎样，往后加，都

2020-07-09 16:21:06 45

Sign In and Sign OutAt the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in’s and out’s, you are supposed to find the ones who

2020-07-09 13:24:29 61

#### 原创 PAT (Advanced Level) Practice 1005 Spell It Right（简单的字符串处理）

Spell It RightGiven a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Specification InputEach input file contains one test case. Each case occupies one line which contains a

2020-07-09 12:50:04 34

#### 原创 PAT (Advanced Level) Practice 1004 Counting Leaves（dfs 建立树）

Counting LeavesA family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input SpecificationEach input file contains one test case. Each case starts with a line containing 0<N<100, t

2020-07-09 12:01:26 40

#### 原创 PAT(Advanced Level)Practice 1003 Emergency（迪杰斯特拉求最短路径，纯C实现）

EmergencyAs an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities

2020-07-09 10:02:45 34

#### 原创 HDU 1002 A + B Problem II（高精度加法，C语言解决）

A + B Problem III have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines foll

2020-07-08 23:00:19 39

#### 原创 HDU 1098 Ignatius‘s puzzle（数学推导，一层循环解决）

Ignatius’s puzzleIgnatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. this problem describes that:f(x)=5x^13+13x^5+kax,input a nonegative integer k(k<10000),to find the minimal nonegative integer a,make

2020-07-08 17:53:03 48

#### 原创 HDU 1097 A hard puzzle （快速幂运算 取模）

A hard puzzlelcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,so lcy makes the problem easier than begin.this puzzle describes that: gave a and b,how to know the a^b’s

2020-07-08 16:04:47 33

#### 原创 HDU 1172 猜数字（暴力 + 模拟 == 简洁代码）

2020-07-08 11:52:01 94

#### 原创 POJ 3006 Dirichlet‘s Theorem on Arithmetic Progressions（又双叒叕是素数筛）

Dirichlet’s Theorem on Arithmetic ProgressionsIf a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, i.e., a, a + d, a + 2d, a + 3d, a + 4d, …, contains infinitely many prime numbers. This fact is

2020-07-08 08:20:41 36

#### 原创 POJ 1019 Number Sequence（数学技巧轻松解决）

Number SequenceA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2…Sk. Each group Sk consists of a sequence of positive integer numbers ranging from 1 to k, written one a

2020-07-07 21:38:00 39

#### 原创 POJ 2136 Vertical Histogram（实属水题）

Vertical HistogramWrite a program to read four lines of upper case (i.e., all CAPITAL LETTERS) text input (no more than 72 characters per line) from the input file and print a vertical histogram that shows how many times each letter (but not blanks, digi

2020-07-07 16:42:37 42

#### 原创 HDU 1304 A Contesting Decision（结构体的简单应用）

A Contesting DecisionJudging a programming contest is hard work, with demanding contestants, tedious decisions, and monotonous work. Not to mention the nutritional problems of spending 12 hours with only donuts, pizza, and soda for food. Still, it can be

2020-07-07 11:01:27 58

#### 原创 OpenJ_Bailian - 3711 字符串移位包含问题（模拟 + 简单解法）

2020-07-05 16:26:39 82

2020-07-05 09:39:31 832

#### 原创 HDU 1016 Prime Ring Problem（深搜+回溯+剪枝+Eratosthenes素数筛）

Prime Ring ProblemA ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the number of first circle should always be 1.In.

2020-07-04 22:25:58 52

#### 原创 HDU 1013 Digital Roots（九余数定理 + 暴力解法）

Digital RootsThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed.

2020-07-04 17:53:28 80

#### 原创 HDU 1018 Big Number（简单数学解法无需高精度）

Big NumberIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in t.

2020-07-04 15:32:33 80

#### 原创 HDU1048 The Hardest Problem Ever（AC代码 + scanf小技巧）

2020-07-04 09:28:53 92

#### 原创 POJ2739 Sum of Consecutive Prime Numbers（AC代码 + 详解）

Sum of Consecutive Prime NumbersSome positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integer 53 has two representations 5 + 7 + 1.

2020-07-03 20:59:23 94

#### 原创 线性筛法求素数

2020-07-03 00:07:06 69

#### ACM_算法模板集史上最完整收藏版223页pdf

ACM_算法模板集史上最完整收藏版223页 ACM_算法模板集史上最完整收藏版 ACM_算法模板集史上最完整收藏版

2019-12-19

###### 空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人 TA的粉丝