
暴力/模拟
文章平均质量分 85
码代码的猿猿的AC之路
人一我百,人十我万追逐青春的梦想,怀着自信的心,永不放弃
展开
-
HDOJ 4274 Spy's Work DFS
DFS维护每个节点可以表示的范围….Spy’s WorkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1382 Accepted Submission(s): 438Problem Description I’m a manag原创 2015-09-07 21:05:06 · 573 阅读 · 0 评论 -
Codeforces 520D. Cubes 贪心模拟
每一步都取当前稳定的格子里面数字最大或者最小的数.用一个set维护当前可取的格子 *begin 最大 *(--end) 最小每删除一个格子都要对这个格子周围的6个格子进行稳定性检查一个格子上面的3个格子确定了这个格子的稳定性D. Cubestime limit per test3 secondsmemory limit pe原创 2015-03-04 17:44:04 · 1687 阅读 · 0 评论 -
HDOJ 5128 The E-pang Palace 暴力枚举+计算几何
枚举出每一个矩形,判断相交如果是回字型则输出大的矩形的面积..........The E-pang PalaceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 73 Accepted Submission(s):原创 2014-12-04 10:42:12 · 1745 阅读 · 0 评论 -
Codeforces 479B. Towers 暴力
纯暴力.....B. Towerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs you know, all the kids原创 2014-11-06 17:16:58 · 865 阅读 · 0 评论 -
Codeforces 383B. Volcanoes 模拟
记录每一层可以移动到的区间....非常多的细节...B. Volcanoestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIahub原创 2014-11-27 11:34:57 · 1497 阅读 · 0 评论 -
HDOJ 5098 Smart Software Installer 拓扑排序
拓扑排序:两个队列,一个放不需要重启入度为0的,一个放需要重启入度为0的....从不需要重启的队列开始,每弹出一个数就更新下入度,遇到入读为0的就加入到相应队列里,当队列空时,记录重启次数+1,交换队列..一直到两个队列都为空Smart Software InstallerTime Limit: 2000/1000 MS (Java/Others) Memory原创 2014-11-04 10:42:31 · 1238 阅读 · 0 评论 -
HDOJ 4690 EBCDIC 模拟
EBCDICTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 811 Accepted Submission(s): 368Problem DescriptionA mad scientist fou原创 2014-11-04 20:09:17 · 964 阅读 · 0 评论 -
ZOJ 2610 Puzzle 模拟
大模拟:枚举6个方向,检查每个0能否移动PuzzleTime Limit: 2 Seconds Memory Limit: 65536 KBLittle Georgie likes puzzles very much. Recently he has found a wooden triangle in the box with old toys. The原创 2014-10-18 17:39:32 · 1090 阅读 · 0 评论 -
ZOJ 3826 Hierarchical Notation 模拟
模拟: 文法分析hash每个Key建图,对每个节点记录在原串的第几个位置开始输出。。。。对每个询问沿图走就可以了。。。。Hierarchical NotationTime Limit: 2 Seconds Memory Limit: 131072 KBIn Marjar University, students in College of Co原创 2014-10-15 13:21:07 · 1512 阅读 · 0 评论 -
HDOJ 4699 Editor 栈 模拟
用两个栈模拟:EditorTime Limit: 3000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1913 Accepted Submission(s): 591Problem Description原创 2014-10-24 16:05:10 · 1374 阅读 · 0 评论 -
Codeforces 475 D. CGCDSSQ
暴力+维护某个数到前面一个能产生不同GCD的数的位置.......D. CGCDSSQtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output原创 2014-10-08 15:09:00 · 1873 阅读 · 0 评论 -
HDOJ 5071 Chat 模拟
大模拟:1》saygoodbye要先对 always on top 的人说2》对没有说过话的不要说good bye3》用long longChatTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s原创 2014-10-23 00:00:25 · 1294 阅读 · 0 评论 -
Codeforces 67A. Partial Teacher
贪心A. Partial Teachertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA teacher decides to gi原创 2014-09-03 21:43:39 · 943 阅读 · 0 评论 -
BZOJ 1088: [SCOI2005]扫雷Mine 枚举
枚举前两位,递推剩下的1088: [SCOI2005]扫雷MineTime Limit: 10 Sec Memory Limit: 162 MBSubmit: 1832 Solved: 1090[Submit][Status][Discuss]Description相信大家都玩过扫雷的游戏。那是在一个n*m的矩阵里面有一些雷,要你根据一些信息找出雷来。万圣节原创 2015-04-28 23:20:19 · 891 阅读 · 0 评论 -
HDOJ 5229 ZCC loves strings
ZCC loves stringsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others)Total Submission(s): 184 Accepted Submission(s): 70Problem DescriptionZCC has g原创 2015-05-16 23:34:46 · 1260 阅读 · 0 评论 -
HDOJ 5414 CRB and String 模拟
CRB and StringTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 491 Accepted Submission(s): 186Problem DescriptionCRB has two s原创 2015-08-21 11:28:52 · 1101 阅读 · 0 评论 -
HDOJ 5402 Travelling Salesman Problem 模拟
行数或列数为奇数就可以全部走完.行数和列数都是偶数,可以选择空出一个(x+y)为奇数的点.如果要空出一个(x+y)为偶数的点,则必须空出其他(x+y)为奇数的点Travelling Salesman ProblemTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java原创 2015-08-19 17:39:15 · 823 阅读 · 0 评论 -
HDOJ 5399 Too Simple
每一个函数都必须是一个排列,经过连续的一段确定函数后数字不能少.满足上面的条件的话,只要有一个-1函数特别的排列一下就可以满足要求,剩下的可以随意填没有-1的话特判Too SimpleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total S原创 2015-08-19 13:35:59 · 762 阅读 · 0 评论 -
HDOJ 5400 Arithmetic Sequence 暴力枚举
Arithmetic SequenceTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 382 Accepted Submission(s): 196Problem DescriptionA sequen原创 2015-08-19 00:21:55 · 957 阅读 · 0 评论 -
HDOJ 5424 Rikka with Graph II 暴力dfs
哈密顿路径本来是NPC的问题,不过这题可以特判后直接暴力dfsRikka with Graph IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1066 Accepted Submission(s): 271原创 2015-09-03 08:48:59 · 830 阅读 · 0 评论 -
HDOJ 5338 ZZX and Permutations 线段树+树状数组
给一个排列加上表示循环的括号,问如何让1到n的对应的字典序最大.从1开始贪心每个数字可以往三个地方走,右边第一个,跳转到左边的某一个,和自己构成循环对于走到右边第一个的情况,只要判断右边的那个有没有被占据就可以了,如果可以huan跳转到左边的某一个,用一个线段树查询区间里的最大值ZZX and PermutationsTime Limit: 60原创 2015-08-03 22:12:51 · 703 阅读 · 0 评论 -
HDOJ 5387 Clock 水+模拟
ClockTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 316 Accepted Submission(s): 215Problem DescriptionGive a time.(hh:mm:ss)原创 2015-08-14 10:13:04 · 785 阅读 · 0 评论 -
HDOJ 5336 XYZ and Drops 模拟
暴力模拟XYZ and DropsTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 230 Accepted Submission(s): 35Problem DescriptionX原创 2015-07-30 19:19:07 · 1103 阅读 · 0 评论 -
ZOJ 3883 Scan Code 模拟
模拟,考虑shift 和 caps 的各种组合Scan CodeTime Limit: 2 Seconds Memory Limit: 65536 KBEdward is writing an editor. After he wrote the function to get input from his special keyboard, he f原创 2015-08-24 20:32:23 · 1180 阅读 · 0 评论 -
HDOJ 5358 First One 暴力
⌊log2S(i,j)⌋+1 就是S(i,j) 的二进制位数.....枚举二进制的每一位数,计算相应的权值具体作法就是对每个二进制位数 i ,扫一遍数组,对每个数 j 维护一个L,R 表示以该数为左端点,右端点可以在L~R的范围,这个区间内的值加起来有 i 位二进制位数,那么这个数对答案的贡献为 设: dur = (R-L+1) 贡献值: dur*j+(R+L)*dur/2原创 2015-08-07 22:54:48 · 692 阅读 · 0 评论 -
HDOJ 5353 Average 模拟
各种情况特判,然后枚举前两个点之间的关系AverageTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1723 Accepted Submission(s): 438Special JudgeP原创 2015-08-08 21:50:01 · 787 阅读 · 0 评论 -
HDOJ 5276 YJC tricks time multimap
multimap的使用YJC tricks timeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/262144 K (Java/Others)Total Submission(s): 492 Accepted Submission(s): 215Problem Descri原创 2015-07-10 09:52:10 · 983 阅读 · 0 评论 -
Codeforces 466 B. Wonder Room
暴力+乱搞B. Wonder Roomtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe start of the new aca原创 2014-09-13 10:25:26 · 1858 阅读 · 0 评论 -
Codeforces 466 A. Cheap Travel
A. Cheap Traveltime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnn has recently started commuting by subway原创 2014-09-13 10:21:21 · 2139 阅读 · 0 评论 -
SWERC13 Trending Topic
map暴力。。。Imagine you are in the hiring process for a company whose principal activity is the analysisof information in the Web. One of the tests consists in writing a program for maintaining up原创 2014-08-25 01:21:15 · 1775 阅读 · 0 评论 -
USACO Sorting a Three-Valued Sequence
Sorting a Three-Valued Sequence IOI'96 - Day 2Sorting is one of the most frequently performed computational tasks. Consider the special sorting problem in which the records to be sorted have at原创 2014-02-04 14:22:40 · 1450 阅读 · 0 评论 -
Codeforces 382 C. Arithmetic Progression
先由小到大排序1:只有一个数 无限多2:存在3种以上的间距 无3:出现2种间距大的间距只有1个,且长度是小的两倍 1种大的间距有几个 无4:只有1种间距只出现一次 一头一尾 或者 加上中间**仅有的间距是0 1种C. Arithmetic Progressiontime limit per test1原创 2014-01-18 02:00:27 · 2262 阅读 · 0 评论 -
USACO Name That Number
Name That NumberAmong the large Wisconsin cattle ranchers, it is customary to brand cows with serial numbers to please the Accounting Department. The cow hands don't appreciate the advantage of原创 2013-12-24 21:11:01 · 1297 阅读 · 0 评论 -
USACO Transformations
TransformationsA square pattern of size N x N (1 <= N <= 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformati原创 2013-12-24 12:38:46 · 1402 阅读 · 0 评论 -
UVA 11020 Efficient Solutions
mulitset可以当BST用。。。Efficient SolutionsTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %llu[Submit] [Go Back] [Status] DescriptionProb原创 2013-12-20 23:21:08 · 1495 阅读 · 0 评论 -
CodeForces 374 A. Inna and Pink Pony
一定要考虑全面啊。。。。。A. Inna and Pink Ponytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDima and In原创 2013-12-19 15:28:31 · 1516 阅读 · 0 评论 -
USACO Prime Cryptarithm
Prime CryptarithmThe following cryptarithm is a multiplication problem that can be solved by substituting digits from a specified set of N digits into the positions marked with *. If the set of原创 2014-01-02 14:51:45 · 1080 阅读 · 0 评论 -
CodeForces 373 B. Making Sequences is Fun
B. Making Sequences is Funtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe'll define S(n) for positive i原创 2013-12-15 15:02:19 · 1436 阅读 · 0 评论 -
POJ 1955 Rubik's Cube
暴力模拟就好了。。。。vim写代码真费事,手都写酸了。。。Rubik's CubeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 638 Accepted: 324DescriptionBackground Rummaging th原创 2013-12-04 21:37:14 · 2029 阅读 · 0 评论 -
CodeForces 371D. Vessels
暴力+胡乱优化就过了。。tags给的东西似乎什么都没用到。。。。。CF的数据是不是有点水啊。。。。。果然是没有营养的题目。。。。。D. Vesselstime limit per test2 secondsmemory limit per test256 megabytesinputstandard input原创 2013-12-10 19:30:34 · 1287 阅读 · 0 评论