/*代码一:DFS+Enum*///Memory Time //240K 344MS
//本题只要求输出翻转的次数,因此BFS或DFS都适用#includeusing namespace std;bool
chess[6][6]={false};//利用的只有中心的4x4bool flag;in.....
分类:
其他好文 时间:
2014-05-26 22:45:54
阅读次数:
323
Sudoku is a very simple task. A square table with 9
rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure.
In some of the cell...
分类:
其他好文 时间:
2014-05-26 21:55:25
阅读次数:
299
不仅仅是DFS,还需要考虑可以走到终点。同时,需要进行预处理。至多封闭点数为起点和终点的非墙壁点的最小值。
1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7
8 ...
分类:
其他好文 时间:
2014-05-26 13:29:22
阅读次数:
286
DFS算法,非常容易TLE,需要一个boolean矩阵来记录是否访问过某个节点。写DFS主要就是两个方法:用recursion或者Stack,
用recursion会带来time和memory的cost增加,而且因为要用矩阵做argument,
所以非常担心TLE或者MLE的问题。但是用recurs...
分类:
其他好文 时间:
2014-05-26 13:03:20
阅读次数:
273
原题地址:https://oj.leetcode.com/problems/n-queens/题意:经典的N皇后问题。解题思路:这类型问题统称为递归回溯问题,也可以叫做对决策树的深度优先搜索(dfs)。N皇后问题有个技巧的关键在于棋盘的表示方法,这里使用一个数组就可以表达了。比如board=[1,
...
分类:
编程语言 时间:
2014-05-26 10:07:52
阅读次数:
274
GM8138/39相较GM8126/28的改进之处:
1、GM8138支持1080P@45fps,GM8139支持1080P@60fps。GM8128要超频才可以达到1080P@30fps。
2、ISP性能优化,sharpness税利度效果大幅改善。这一点GM8126一直饱受批评。
3、H.264 encoder支持HP,以利于降低bitrate。
4、软件改进:支持kernel 3.3版...
分类:
其他好文 时间:
2014-05-23 01:33:44
阅读次数:
556
介绍一个多选list
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with th...
分类:
其他好文 时间:
2014-05-23 00:52:57
阅读次数:
455
Rescue
Problem Description
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M
Angel's friends want to save Angel. Their task is: a...
分类:
其他好文 时间:
2014-05-23 00:06:37
阅读次数:
482
题目描述 Description
在n×n格的棋盘上放置彼此不受攻击的n个皇后。按照国际象棋的规则,皇后可以攻击与之处在同一行或同一列或同一斜线上的棋子。n后问题等价于再n×n的棋盘上放置n个皇后,任何2个皇后不妨在同一行或同一列或同一斜线上。
输入描述 Input Description
给定棋盘的大小n (n ≤ 13)
输出描述 Outp...
分类:
其他好文 时间:
2014-05-22 23:16:50
阅读次数:
346
在DAG中DFS中顶点的出栈顺序即逆拓扑序。
def topological_sort( graph ):
is_visit = dict( ( node, False ) for node in graph )
li = []
def dfs( graph, start_node ):
for end_node in...
分类:
编程语言 时间:
2014-05-22 23:12:10
阅读次数:
487