POJ 3078 - Shuffle'm Up - [模拟题]】的更多相关文章

题目链接:http://poj.org/problem?id=3087 Description A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C chips. Each…
Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 64795   Accepted: 19978 Description During his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya calendar. From an old knotted message, profes…
Description A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C chips. Each stack may contain chips of several…
题目链接:http://poj.org/problem?id=3087 题目大意:已知两堆牌s1和s2的初始状态, 其牌数均为c,按给定规则能将他们相互交叉组合成一堆牌s12,再将s12的最底下的c块牌归为s1,最顶的c块牌归为s2,依此循环下去. 现在输入s1和s2的初始状态 以及 预想的最终状态s12.问s1 s2经过多少次洗牌之后,最终能达到状态s12,若永远不可能相同,则输出"-1". 解题思路:照着模拟就好了,只是判断是否永远不能达到状态s12需要用map,定义map<…
题目地址:http://poj.org/problem?id=1028 测试样例: Sample Input VISIT http://acm.ashland.edu/ VISIT http://acm.baylor.edu/acmicpc/ BACK BACK BACK FORWARD VISIT http://www.ibm.com/ BACK BACK FORWARD FORWARD FORWARD QUIT Sample Output http://acm.ashland.edu/ ht…
题意:给定s1,s1两副扑克,顺序从下到上.依次将s2,s1的扑克一张一张混合.例如s1,ABC; s2,DEF. 则第一次混合后为DAEBFC. 然后令前半段为s1, 后半段为s2. 如果可以变换成所给出的字符串,输出变换次数即可:否则,输出-1. 这题数据太水了,我是这样判断无法变换成题目所给出的字符串的:将每一次变换后的字符串存进数组,每次变换后由于之前变换后的字符串相比较,如果有相同的,就说明会无限循环下去.这样一来,循环次数会增加很多,然而0ms过了... #include <iost…
                                                                                                               Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 11462   Accepted: 5558 Description A robot has been programmed to…
题目:http://poj.org/problem?id=3393 不多说了,简单模拟题,因为粗心写错了两个字母,导致错了N遍,模拟还是一贯的恶心,代码实在不想优化了,写的难看了点.. #include <stdio.h> #include <string.h> ; ; ] = {, , , , , , , , , , , , }; ][]; ][][]; int main() { ; i <= ; i++) { memcpy(days[i], month, sizeof(m…
http://www.cppblog.com/Uriel/articles/101592.html 感觉这个暑假没有去年有激情啊,,,还没到状态就已经块上学了,,, 真是弱暴了,,,找几道模拟题刷刷... 标加号表示已AC... + 1008   历法,不难 + 1102   不难. + 1028   纯模拟.被题目坑了一下.. 1023   貌似搞了一会儿.. 1051   算是模拟,写得比较麻烦,要细心 1099   跟化学式有关的模拟,有意思,高兴的是这题完全是自己想的AC的.. 1107…
题目链接: http://poj.org/problem?id=3923 题意描述: 输入一个n*m的屏幕 该屏幕内有至少一个对话框(每个对话框都有对应的字母表示) 判断并输出该屏幕内处于最表层的对话框是哪些(有多个的话按字典序) 解题思路: 很接近生活的一道模拟题,考察了思维的缜密性,尤其是出现嵌套情况时,应该输出里层的对话框编号即可. AC代码: #include<stdio.h> #include<string.h> #include<ctype.h> ][];…