- 博客(711)
- 收藏
- 关注
原创 Codeforces 1070D - Garbage Disposal
题目:https://codeforces.com/problemset/problem/1070/D解题思路:1.若前一天有垃圾剩余,则今天应至少处理一次2.若前一天没有垃圾剩余。且今天的垃圾未填满垃圾袋,则可以暂不处理代码:#include<cstdio>#include<map>#include<queue>using namespace ...
2018-10-29 21:38:26
621
原创 codeforces 1073D - Berland Fair
题目 :https://codeforces.com/problemset/problem/1073/D思路:把价格小于当前钱的糖果放入队列里,并记录队列里所有糖果的价格和每次变量前:1.先看当前钱够买多少轮队列里的糖果2 . 遍历队列,并把仍然小于当前钱数的糖果再次加入队列代码:#include<cstdio>#include<map>#include...
2018-10-28 21:10:48
412
原创 HDU-1207-汉诺塔II
Problem Description 经典的汉诺塔问题经常作为一个递归的经典例题存在。可能有人并不知道汉诺塔问题的典故。汉诺塔来源于印度传说的一个故事,上帝创造世界时作了三根金刚石柱子,在一根柱子上从下往上按大小顺序摞着64片黄金圆盘。上帝命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并且规定,在小圆盘上不能放大圆盘,在三根柱子之间一回只能移动一个圆盘。有预言说,这件事完成时宇宙...
2018-02-26 16:00:39
250
原创 HDU-2064 汉诺塔III
汉诺塔III Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 20387 Accepted Submission(s): 9714Problem Description 约19世纪末,在欧州的商店中出售一种智力玩具,在一块...
2018-02-25 17:07:47
235
原创 【Lightoj 1251 Forming the Council】& Tarjan & 2 - SAT
In a city there are n voters, and m people formed the Govt. council. The council members are numbered from 1 to m. Now everyone is complaining that the council is biased. So, they made a plan. The plan
2017-10-17 08:45:24
458
原创 【Codeforces B. Balanced Substring】
B. Balanced Substring time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given a string s consisting only of characters 0 and 1. A sub
2017-10-12 23:19:01
1248
原创 【Lightoj 1063 - Ant Hills】& 割点
After many years of peace, an ant-war has broken out.In the days leading up to the outbreak of war, the ant government devoted a great deal of resources toward gathering intelligence on ant hills. It d
2017-10-12 20:19:34
705
原创 【Lightoj 1026 B Critical Links】& 桥
In a computer network a link L, which interconnects two servers, is considered critical if there are at least two servers A and B such that all network interconnection paths between A and B pass throug
2017-10-12 14:24:03
416
原创 【UVA 10034 Freckles】& Kruskal & 最小生成树
In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad’s back to form a picture of the Liberty Bell. Alas, one of the freckles turns out to be a scar, so his Ripley’s
2017-10-11 22:28:32
357
原创 【UVA 10397 Connect the Campus】& 最小生成树 & Kruskal
Many new buildings are under construction on the campus of the University of Waterloo. The university has hired bricklayers, electricians, plumbers, and a computer programmer. A computer programmer?
2017-10-11 21:32:45
296
原创 【Codeforces 869 C The Intriguing Obsession】& 组合数学 & 思维
C. The Intriguing Obsession time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output — This is not playing but duty as allies of justice, Nii-chan!—
2017-10-11 12:22:23
472
原创 【HDU 5952 Counting Cliques】& DFS
Counting CliquesTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2715 Accepted Submission(s): 982Problem Description A clique is a complete
2017-10-08 18:27:05
375
原创 【HDU 6000 Wash】优先队列 & 贪心
WashTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 64000/64000 K (Java/Others) Total Submission(s): 1076 Accepted Submission(s): 283Problem Description Mr.Panda is about to engage in hi
2017-10-07 17:42:13
917
原创 【HDU 5983 Pocket Cube】& 模拟
Pocket CubeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1075 Accepted Submission(s): 415Problem Description The Pocket Cube, also known
2017-10-07 11:46:03
519
原创 【Codeforces 868 B. Race Against Time】& 模拟
B. Race Against Time time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Have you ever tried to explain to the coordinator, why it is eight ho
2017-10-06 11:51:22
341
原创 【HDU 3376 Matrix Again】网络流 & 拆点 & 最大费用最大流
Matrix AgainTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others) Total Submission(s): 4444 Accepted Submission(s): 1292Problem Description Starvae very like play a
2017-10-06 09:31:40
707
原创 【POJ 2135 Farm】网络流 & 最小费用最大流
Farm Tour Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 17964 Accepted: 6949 DescriptionWhen FJ’s friends visit him on the farm, he likes to show them around. His farm compr
2017-10-04 16:56:26
314
原创 【POJ 1149 PIGS】网络流 & 合并节点简化构图 & Dinic算法
PIGS Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 21812 Accepted: 9975 DescriptionMirko works on a pig farm that consists of M locked pig-houses and Mirko can’t unlock any
2017-10-02 22:13:47
741
原创 【UVA 673 Parentheses】 & 栈
You are given a string consisting of parentheses () and []. A string of this type is said to be correct: (a) if it is the empty string (b) if A and B are correct, AB is correct, (c) if A is correct,
2017-10-02 18:12:30
276
原创 【POJ 2112 Optimal Milking】网络流 & 二分 & floyd
Optimal Milking Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 18478 Accepted: 6594 Case Time Limit: 1000MS DescriptionFJ has moved his K (1 <= K <= 30) milking machines out
2017-10-02 16:35:54
339
原创 【UVA 712 S-Tree】& 二叉树
A Strange Tree (S-tree) over the variable set Xn = {x1, x2, … , xn} is a binary tree representing a Boolean function f : {0, 1} n → {0, 1}. Each path of the S-tree begins at the root node and consist
2017-10-01 20:38:28
773
原创 【UVA 548 Tree】二叉树构造 & 遍历
You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary tree to any leaf. The value of a path is the sum o
2017-10-01 18:55:44
656
原创 【POJ 3436 ACM Computer Factory】网络流 & 拆点 & Dinic
ACM Computer Factory Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8323 Accepted: 3027 Special Judge DescriptionAs you know, all the computers used for ACM contests must b
2017-10-01 17:06:12
888
原创 【POJ 3281 Dining】& 网络流Dinic & 拆点
Dining Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 19539 Accepted: 8697 DescriptionCows are such finicky eaters. Each cow has a preference for certain foods and drinks, an
2017-09-29 09:33:10
297
原创 【Codeforces 864 C. Bus】
C. Bus time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A bus moves along the coordinate line Ox from the point x = 0 to the point x = a. A
2017-09-27 10:39:10
567
原创 【POJ 1273 Drainage Ditches】& 网络流 & Dinic 算法
Drainage Ditches Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 78164 Accepted: 30497 DescriptionEvery time it rains on Farmer John’s fields, a pond forms over Bessie’s favor
2017-09-21 21:23:28
289
原创 【POJ 1273 Drainage Ditches】 & 网络流 & Edmonds-Karp算法
Drainage Ditches Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 78115 Accepted: 30465 DescriptionEvery time it rains on Farmer John’s fields, a pond forms over Bessie’s favor
2017-09-19 21:55:51
476
原创 【PAT 1135. Is It A Red-Black Tree (30)】& 二叉树
Is It A Red-Black Tree (30)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue There is a kind of balanced binary search tree named red-black tree in the data structure. It h
2017-09-19 17:05:50
2924
原创 【1008 Deduplication on a Linked List (25)】+ 链表
题目描述 Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, only the first node of which the valu
2017-09-15 08:57:52
318
原创 【PAT 1006 Cars on Campus (30)】
题目描述 Zhejiang University has 6 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the information available
2017-09-14 17:43:42
319
原创 【 PAT 1007 Consecutive Factors (20)】
题目描述 Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3*5*6*7, where 5, 6, and 7 are the three consecutive numbers. Now
2017-09-13 08:11:42
313
原创 【PAT 1004 Acute Stroke (30)】& dfs
题目描述 One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job i
2017-09-05 17:14:35
257
原创 【PAT 1005 The Largest Generation (25)】& 树 & dfs
题目描述 A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest population.输入
2017-09-05 16:22:18
364
原创 【PAT 1003 Highest Price in Supply Chain (25)】 & dfs
A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)– everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the ch
2017-09-05 15:41:39
291
原创 【Codeforces 600C. Make Palindrome】& 构造
C. Make Palindrome time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A string is called palindrome if it reads the same from left to right a
2017-08-23 18:05:22
404
原创 【Gym - 101350A. Sherlock Bones】 & 思维
A. Sherlock Bones time limit per test1.5 s memory limit per test256 MB inputstandard input outputstandard output The great dog detective Sherlock Bones is on the verge of a new discovery. But for
2017-08-23 17:37:22
639
原创 【FZUoj 2283 Tic-Tac-Toe】& dfs & 博弈
Problem 2283 Tic-Tac-Toe Accept: 159 Submit: 340 Time Limit: 1000 mSec Memory Limit : 262144 KBProblem DescriptionKim likes to play Tic-Tac-Toe.Given a current state, and now Kim is goin
2017-08-21 22:08:36
490
原创 【Gym - 101350 E - Competitive Seagulls】 & 博弈
There are two seagulls playing a very peculiar game. First they line up N unit squares in a line, all originally colored white.Let L be the length of the longest continuous sub-segment of white unit sq
2017-08-21 21:13:48
813
原创 【Gym - 101350 D - Magical Bamboos 】& gcd
In a magical forest, there exists N bamboos that don’t quite get cut down the way you would expect.Originally, the height of the ith bamboo is equal to hi. In one move, you can push down a bamboo and d
2017-08-21 21:03:36
476
原创 【 Gym - 101350 D - Magical Bamboos】
In a magical forest, there exists N bamboos that don’t quite get cut down the way you would expect.Originally, the height of the ith bamboo is equal to hi. In one move, you can push down a bamboo and d
2017-08-21 20:50:30
649
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人