
模拟
coldfresh
那我们开始吧
展开
-
Pocket Cube HDU - 4801 (dfs)
Pocket Cube is a 3-D combination puzzle. It is a 2 × 2 × 2 cube, which means it is constructed by 8 mini-cubes. For a combination of 2 × 2 mini-cubes which sharing a whole cube face, you can twist it 9原创 2017-09-29 15:15:00 · 355 阅读 · 0 评论 -
(pat)A1014. Waiting in Line
Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are:1.The spa...原创 2018-03-10 16:25:26 · 267 阅读 · 0 评论 -
Editor HDU - 4699 (模拟)
Input 8 I 2 I -1 I 1 Q 3 L D R Q 2 Output 2 3思路:就是模拟了,关键是怎么模拟了,这里用两个栈,如果左移就做边出栈,然后压到右边的栈。通过两个栈来模拟光标左右移动,其也就差不多了。 代码:#include<iostream>#include<cstdio>#include<sta...原创 2018-05-03 14:11:38 · 302 阅读 · 0 评论 -
【51nod 1293】 球与切换器(dp、模拟)
题目来源: Codility基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题有N行M列的正方形盒子。每个盒子有三种状态0, -1, +1。球从盒子上边或左边进入盒子,从下边或右边离开盒子。规则:如果盒子的模式是-1,则进入它的球从下面出去。(方向变为向下)如果盒子的模式是+1,则进入它的球从右面出去。 (反向变为向右)如果盒子的模式是0, 则进入它的球方...原创 2018-10-15 21:54:36 · 257 阅读 · 0 评论