如果在文章中出现连续引用多个参考文献的情况,希望显示的格式为 [1-5,9,12],那么可以如下处理:在文章的导言区加\usepackage[square, comma, sort&compress, numbers]{natbib}在文章正文中需要引用参考文献的地方使用:\cite{liu2012...
分类:
其他好文 时间:
2015-04-30 13:56:39
阅读次数:
315
题意:
给定一个火柴棒拼成的方格阵,然后去掉一些火柴棒,问至少再去掉几根火柴棒能够让图中一个正方形都没有。
思路:
1. 由于题目中给定了 n 的范围,2 * n * (n + 1) 所以能够保证所有的火柴用 __int64 的位运算表示;
2. 问题的关键在于如何生成火柴构成的方阵,以及生成方阵之后如何去搜索;
3. 启发式函数 h 的计算需要考量:如果删除了某个...
分类:
其他好文 时间:
2015-04-30 09:05:42
阅读次数:
127
题目传送:UVA - 10023
思路:模拟手算开方,不想用c/c++,感觉太麻烦了,就直接用的java里的BigInteger类来写的,写了好久......Java还是得看看书呀,手算开方参考的这里
AC代码:
import java.util.Scanner;
import java.math.BigInteger;
public class Main ...
分类:
其他好文 时间:
2015-04-29 17:06:25
阅读次数:
104
其中是利用, 正方形, 长方形, 圆形;来继承接口All 接口, 来实现All的情况。
少说废话,上代码:
import java.util.*;
interface S
{
void s();
}
interface C
{
void c();
}
interface All extends S,C
{
//这是实现接口的多重的继承
}
class Square imple...
分类:
编程语言 时间:
2015-04-28 23:04:42
阅读次数:
386
Write an algorithm to determine if a number is “happy”.
A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the square...
分类:
移动开发 时间:
2015-04-25 00:21:22
阅读次数:
153
Description
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 cells are written decimal digits from 1...
分类:
其他好文 时间:
2015-04-23 13:17:16
阅读次数:
144
额,简单的BFS,一开始DFS结果栈炸了,加栈也不行 QAQ
#include
#include
#include
#include
using namespace std;
const int maxn = 100;
const int dir[6][3] ={{0,0,1},{0,0,-1},{0,1,0},{0,-1,0},{1,0,0},{-1,0,0}};
#define FOR(i,...
分类:
其他好文 时间:
2015-04-22 22:19:07
阅读次数:
141
《Effective C++》第六章:继承与面向对象设计
确定你的public继承塑模出is-a关系。student is a person,所以student可以public继承自person。概念上,正方形是长方形,但是如果让square继承自rectangle呢,square需要像rectangle那样具有长和宽两个成员变量吗?如果是,每次改变正方形的宽的时候,也要改变正方形的长,这很奇怪不是...
分类:
编程语言 时间:
2015-04-22 15:19:17
阅读次数:
155
题目传送门 1 /* 2 DFS:问能否用小棍子组成一个正方形 3 剪枝有3:长的不灵活,先考虑;若根本构不成正方形,直接no;若第一根比边长长,no 4 这题是POJ_1011的精简版:) 5 */ 6 #include 7 #include 8 #include 9...
分类:
其他好文 时间:
2015-04-21 17:34:41
阅读次数:
142
lazy gege
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 948 Accepted Submission(s): 361
Problem Description
Gege hasn't tidied h...
分类:
其他好文 时间:
2015-04-21 14:43:14
阅读次数:
137