排序。 分别按照$x$,$y$以及对角线排序,统计一下方案数就可以了。 ...
                            
                            
                                分类:
其他好文   时间:
2017-04-08 22:34:56   
                                阅读次数:
426
                             
                         
                    
                        
                            
                            
                                题意:沿着x轴从0走到大于等于N的某处,每一步的步数由骰子(1,2,3,4,5,6)决定,若恰好走到x轴上某飞行路线的起点,则不计入扔骰子数。问从0走到大于等于N的某处的期望的扔骰子次数。 分析: 1、dp[i]表示从位置i到终点期望的扔骰子次数。 2、很显然倒着往前推,因为从起点0开始,扔骰子的次 ...
                            
                            
                                分类:
其他好文   时间:
2017-04-01 19:44:22   
                                阅读次数:
186
                             
                         
                    
                        
                            
                            
                                Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this  ...
                            
                            
                                分类:
其他好文   时间:
2017-03-28 00:31:42   
                                阅读次数:
203
                             
                         
                    
                        
                            
                            
                                理解定义:定义一组算法,分别封装使得它们之间可以相互替换,保证算法的变化独立与使用算法的用户。举例:Character代表国际象棋的每个角色King、Queen等代表具体的对象fight表示每个角色如何战争
                            
                            
                                分类:
其他好文   时间:
2017-03-06 22:30:53   
                                阅读次数:
144
                             
                         
                    
                        
                            
                            
                                定义一个公用的内部 public interface ClessFlyWeight {	void setColor(String c);	String getColor();	void display(Coordinate c);}class ConcreteChess implements Cle ...
                            
                            
                                分类:
编程语言   时间:
2017-03-05 20:58:17   
                                阅读次数:
214
                             
                         
                    
                        
                            
                            
                                    题目链接:hdu 4405 Aeroplane chess 题意: 一个0到n的数轴上掷色子前进,中间有直达部分,问到终点需要掷色子的期望。 题解: 无环的期望DP,直接递推就行。 1 #include<bits/stdc++.h> 2 #define F(i,a,b) for(int i=a;i< ...
                            
                            
                                分类:
其他好文   时间:
2017-02-07 19:24:40   
                                阅读次数:
179
                             
                         
                    
                        
                            
                            
                                方法:dfs 状态压缩 方法比较明显,就是一个基本的回溯问题。据说直接做会超时,然而我还是过了。。 code: 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #include <iostream> 5 #inclu ...
                            
                            
                                分类:
其他好文   时间:
2017-02-01 10:38:27   
                                阅读次数:
174
                             
                         
                    
                        
                            
                            
                                #include using namespace std; struct chess{ int x; }; int color[1000]={0}; int maxnum; int data[1000][1000]={0}; chess p[1000]; int flag; void bfs(int... ...
                            
                            
                                分类:
其他好文   时间:
2017-01-22 12:01:59   
                                阅读次数:
177
                             
                         
                    
                        
                            
                            
                                    期望,$dp$。 设$dp[i]$表示当前在位置$i$,到达目标位置所需的期望步数。 因为有直接跳跃的方案,所以要先预处理好每一个位置最后跳在哪个位置,设位置$i$最终跳到了位置$t[i]$。 那么,$dp[i]=sum(1/6*dp[t[i+j]])+1$。 ...
                            
                            
                                分类:
其他好文   时间:
2017-01-19 09:34:05   
                                阅读次数:
167
                             
                         
                    
                        
                            
                            
                                    题目链接: A Simple Chess Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description There is a n×m board, a ches ...
                            
                            
                                分类:
其他好文   时间:
2017-01-15 00:17:31   
                                阅读次数:
273