[题目链接:HDOJ-2952] Counting Sheep Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2476 Accepted Submission(s): 1621 Problem Description A while ago I had trouble sleeping. I used to lie awake,…
F - Almost Sorted Array Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5532 Description We are all familiar with sorting algorithms: quick sort, merge sort, heap sort, insertion sort, selectio…
--------------------------------------------- 这道题有点坑,也怪我总是有点马虎,按照正常人的思维0是表示有水池啊竟然是1表示有水池,最坑的是写反了竟然还能过样例一直以为是自己程序问题review了好多遍.... 图论基础题,染色法即可. AC代码: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new…
Description Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bought a large decorative chessboard with N rows and M columns. Every day after work, Edward will place…
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…
题意 在 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…