随笔分类 - ACM-动态规划
摘要:好久没有用c++写过代码了,最近没有什么事情,就像做做题。然后发现python用多了C++不会使了。。。。 "1. Longest Substring Without Repeating Characters" Given a string, find the length of the lon
阅读全文
摘要:Contestants DivisionTime Limit: 2000MSDescriptionIn the new ACM-ICPC Regional Contest, a special monitoring and submitting system will be set up, and students will be able to compete at their own univ...
阅读全文
摘要:Corn Fields Time Limit: 2000MSMemory Limit: 65536K Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12
阅读全文
摘要:题目描述 设有N*N的方格图(N<=9),我们将其中的某些方格中填入正整数,而其他的方格中则放人数字0。如下图所示(见样例):A 0 0 0 0 0 0 0 0 0 0 13 0 0 6 0 0 0 0 0 0 7 0 0 0 0 0 0 14 0 0 0 0 0 21 0 0 0 4 0 0 0
阅读全文
摘要:1001:Is Derek lying? 题意: 给你两个人的成绩和答案,判断这两个成绩是否合理。 思路: 先对字符串进行比较,得到相同的选项数same,和不同的选项数diff。如果两个人中最小的成绩小于same,那说明他们相同的选项中有错的。成绩最高的那个对的选项数除了same之外是否超过diff
阅读全文
摘要:The more, The Better 时限:2000ms Problem Description ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须
阅读全文
摘要:Godfather 时限:2000ms Description Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all th
阅读全文
摘要:利用树形dp的思想去求树的重心
阅读全文
摘要:树形dp求树上任一点的最远距离(树的直径)问题
阅读全文
摘要:树形dp,简单状态转移方程,入门级
阅读全文
摘要:A Sagheer and Crossroads 题意: 给你一个双向行驶的十字路口, 每条道路上都以四个灯, l, s, r, p分别表示如图三个方向上和人行道上的红绿灯。如果汽车在绿灯的时候开车撞到了人行道上的人,就会发生交通意外。现在给你每条路上的红绿灯,判断是否会发生交通意外。 思路: 直接
阅读全文
摘要:Humble Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24415 Accepted Submission(s): 107
阅读全文
摘要:Fxx and game Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 347 Accepted Submission(s): 78 Pro
阅读全文
摘要:Function Run Fun Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18338 Accepted: 9372 Description We all love recursion! Don't we? Consider
阅读全文
摘要:Bomb Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 15876 Accepted Submission(s): 5794 Problem
阅读全文
摘要:1079 - Just another Robbery PDF (English) Statistics Forum Time Limit: 4 second(s) Memory Limit: 32 MB As Harry Potter series is over, Harry has no jo
阅读全文
摘要:1033 - Generating Palindromes PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB By definition palindrome is a string which is
阅读全文
摘要:命运 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 17048 Accepted Submission(s): 5950 Problem De
阅读全文
摘要:输入 第1行:字符串A 第2行:字符串B (A,B的长度 <= 1000) 输出 输出最长的子序列,如果有多个,随意输出1个。 输入示例 abcicba abdkscab 输出示例 abca 这道题比较6,但是利用每个位置的记录进行回溯就更6,好好体会下。 输入 第1行:字符串A 第2行:字符串B
阅读全文