2012年6月6日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1865大数的斐波那契数列,又用java猥琐过了。。。View Code import java.io.* ;import java.math.* ;import java.util.* ;import java.text.* ;public class Main{ public static void main(String[]args) { Scanner cin=new Scanner(new BufferedInputStream(System.in)) ; Bi... 阅读全文
posted @ 2012-06-06 22:53 LegendaryAC 阅读(166) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2209艰难的一题,对回溯法的理解又深刻了View Code #include <iostream>using namespace std ;int q[25] ;int cnt[25] ;int len ;int ans ;bool gao(){ for(int i=0;i<len;i++) if(q[i]) return false ; return true ;}void dfs(int idx){ if(gao()) { int ... 阅读全文
posted @ 2012-06-06 20:27 LegendaryAC 阅读(447) 评论(2) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1495bfs,个人感觉很经典的题目,分六种情况搜索View Code #include <iostream>using namespace std ;int s,n,m ;int q[101*101*101][3] ;int dp[101][101][101] ;int bfs(){ if(s&1) return 0 ; if(n<(s>>1)) return 0 ; dp[s][0][0]=0 ; int front=0,rear=1 ; q[fro... 阅读全文
posted @ 2012-06-06 11:07 LegendaryAC 阅读(691) 评论(0) 推荐(0) 编辑