模拟
文章平均质量分 84
FBI-PC
这个作者很懒,什么都没留下…
展开
-
poj1573 Robot Motion
题目链接:http://poj.org/problem?id=1573题目:Robot MotionTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 10202 Accepted: 4971DescriptionA robot h原创 2014-06-12 11:02:19 · 903 阅读 · 0 评论 -
Leetcode_6 ZigZag Conversion
The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H N A P L S I I...原创 2018-05-16 13:11:15 · 110 阅读 · 0 评论 -
codeforces C. Divisibility by Eight (纯属无聊来发一篇博客)
题目:C. Divisibility by Eighttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a原创 2015-06-05 23:02:00 · 804 阅读 · 0 评论 -
hdu 5083Instruction(模拟大法好)
题目链接:huangjing题意:就是解码与编码。。从昨天wa到现在,又是ksh大神给我找的错误,哎,字符串的结尾要以'\0'结尾。。因为可能会影响后面的结果。。题目:InstructionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tota原创 2014-10-26 13:01:14 · 1063 阅读 · 0 评论 -
poj1363Rails(栈模拟)
题目链接:啊哈哈,点我点我思路:这道题就是一道简单的栈模拟。。。。我最开始觉得难处理是当出栈后top指针变化了。。当不满足条件时入栈的当前位置怎么办,这时候想到用一个Copy数组保持入栈记录即可。。当满足所有的火车都出栈时或者已经没有火车可以进栈了,那么久跳出。。最后判断是否出栈的火车是否达到n。。。题目:RailsTime Limit: 1原创 2014-08-13 23:01:38 · 892 阅读 · 0 评论 -
poj3080Blue Jeans
题目链接:啊哈哈,点我点我题意是:给n个字符串然后找出n个字符串里面最长的公共字串。。这道题目最开始以为是dp,后来又以为是kmp,但是kmp貌似没看到过这么多字符串相匹配的,后来就搜题解,太弱了,只能看别人题解。。思路是:首先看数据大小,最多只有10个串,那么把第一个串当作母串,然后逐个去枚举母串中的子串,然后根据字串去其他n-1个DNA序列中检测,看是否这些子串在其原创 2014-08-08 23:26:28 · 704 阅读 · 0 评论 -
uva489 Hangman Judge (模拟)
题目链接:啊哈哈,选我选我思路是:对猜测的字符串进行扫描。。看最后猜错的次数是不是大于等于7,还有就是已经踩过的数字在猜算错误,所以用map判一下重即可。。如果知道这个坑,那么就是水马题。 Hangman Judge In ``Hangman Judge,'' you are to write a program that j原创 2014-08-04 08:31:04 · 856 阅读 · 0 评论 -
uva133 The Dole Queue ( 约瑟夫环的模拟)
题目链接:啊哈哈,选我选我思路是:相当于模拟约瑟夫环,只不过是从顺逆时针同时进行的,然后就是顺逆时针走可以编写一个函数,只不过是走的方向的标志变量相反。。还有就是为了(pos+flag+n-1)%n+1的妙用。。。题目: The Dole Queue In a serious attempt to downsize (reduce原创 2014-08-04 09:11:41 · 1145 阅读 · 0 评论 -
zoj3326An Awful Problem
题目链接:点我点我题目:An Awful ProblemTime Limit: 1 Second Memory Limit: 32768 KBIn order to encourage Hiqivenfin to study math, his mother gave him a sweet candy when the day of the mo原创 2014-07-09 00:37:28 · 801 阅读 · 0 评论 -
Leetcode_36. Valid Sudoku
题目:Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:Each row must contain the digits 1-9 without repetition.Each column must c...原创 2018-08-12 10:27:09 · 110 阅读 · 0 评论