题意 在 n * m 的平面上有若干个袋鼠和墙(1为袋鼠,0为墙),每次可以把所有袋鼠整体往一个方向移动一步(不能走出边界和不能走到墙),为在不超过50000步的情况下能否把全部袋鼠聚集在同一个位置.(类似于2048游戏) 分析 看到网上的题解惊了, 不知道这样做为什么能A,但是写起来真的简单. #include<bits/stdc++.h> using namespace std; int n, m; ]; char dirc[] = {'U', 'D', 'L', 'R'}; int ma…
耐克店 和 苹果店必须相连 Sample Input42 30 01 00 -1 1 -10 Sample Output3.41 # include <iostream> # include <cstdio> # include <cstring> # include <algorithm> # include <cmath> # define LL long long using namespace std ; const int INF=0x…
题目链接:http://codeforces.com/gym/101981/attachments n和m太小,空地联通无环,总步数太大,直接随机输出5w个方向 #include<iostream> #include<algorithm> #include<ctime> using namespace std; int t,a,b,c,d,k; int main() { srand((unsigned)time()); int n,m; ]={'L','R','U','…
Description Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also known as postfix notation since every operator in an expression follows all of its operands. Bob is a student in…
Heshen was an official of the Qing dynasty. He made a fortune which could be comparable to a whole country's wealth by corruption. So he was known as the most corrupt official in Chinese history. But Emperor Qianlong liked, or even loved him so much…