ZOJ 2610 Puzzle 模拟】的更多相关文章

大模拟:枚举6个方向.检查每一个0是否能移动 Puzzle Time Limit: 2 Seconds      Memory Limit: 65536 KB Little Georgie likes puzzles very much. Recently he has found a wooden triangle in the box with old toys. The side of the triangle is n inches long. The triangle is divid…
题目链接:https://cn.vjudge.net/contest/281037#problem/A 题目大意:给你a,b,n.a代表第一个杯子的容量,b代表第二个杯子的容量,然后一共有6种操作.让你用尽可能少的步骤将第二个杯子的当前的水的体积转换成n. 具体思路:就是队列模拟啊,,,,打比赛的时候脑子瓦特了,没读完题目就开始读了,,,这个毛病确实得改了,, AC代码: #include<iostream> #include<stack> #include<iomanip&…
In computer security, Capture the Flag (CTF) is a computer security competition. CTF contests are usually designed to serve as an educational exercise to give participants experience in securing a machine, as well as conducting and reacting to the so…
解题思路:给出两个数列an,bn,其中an,bn中元素的顺序可以任意改变,求an,bn的LCS 因为数列中的元素可以按任意顺序排列,所以只需要求出an,bn中的元素有多少个是相同的即可. 反思:一开始以为就是求LCS,一直WA,后来才发现可以按任意顺序排列元素,把相同的元素都排在一起,就是最长的子序列. Puzzle Time Limit: 2 Seconds      Memory Limit: 65536 KB For sequences of integers a and b, if yo…
#pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #include<iostream> #include<sstream> #include<cmath> #include<climits&g…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4842 要注意题目中两点: 1.在踏入妖怪控制的区域那一刹那,先减行动力,然后才能杀妖怪 2.在妖怪控制区域行动力也会恢复 3.妖怪也许不在自己的控制区域 #include <cstdio> #include <cstring> #include <algorithm> #include <queue> using namespace st…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1009 题目大意:给你三个转换轮,只有当第一个转换轮转动一圈后第二个才会转,当第二个转动一圈后第三个才会转.转换轮的意思是我按动一个按钮,显示器经过转换轮的转换显示另外一个字母.每按下一个按钮,第一个转换轮都会转动一次. 叉姐说得好,多学习一下思维方法,有些问题都是能够很高效率的想出来的.脑洞什么的全是骗人的. 注意看这张图: 中间转动轮的点, 左右两边是一一对应…
Clock Time Limit: 2 Seconds      Memory Limit: 65536 KB You are given a standard 12-hour clock with analog display, an hour hand and a minute hand. How many times does the minute hand pass the hour hand in a given time interval? Sample Input 12 50 1…
2018 German Collegiate Programming Contest (GCPC 18) Attack on Alpha-Zet 建树,求lca 代码: #include <algorithm> #include <iterator> #include <iostream> #include <cstring> #include <cstdlib> #include <iomanip> #include <bit…
题目传送门 /* BFS+模拟:dp[i][j][p] 表示走到i,j,方向为p的步数为多少: BFS分4种情况入队,最后在终点4个方向寻找最小值:) */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <queue> using namespace std; ; cons…