随笔分类 - 模拟
摘要:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1035因为结果要么是有限小数要么是无限循环小数,那么只要模拟这个过程,然后判断循环就跳出,记录循环次数就好。 1 #include 2 #include 3 #inclu...
阅读全文
摘要:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1536不知道为何怎么写都写不对.这题可以模拟.虽然题目保证一定可以从原串变成目标串,但是不一定可以变成两种目标串.所以需要判断下.统计原串中0和1的个数,然后计算目标串中0可能的个数,1可能的个数.计...
阅读全文
摘要:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1537因为给出的式子是必定合法的,只要用两个栈分别保存符号和数字.算出答案后和从左至右算的答案比对即可. 1 #include 2 #include 3 #include 4 #include ...
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5336比较简单的模拟题,题意也很好理解。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #...
阅读全文