题目大意:给定一个n?mn*m的矩阵,要求用正方形砖块覆盖,使得任意两块同颜色的正方形砖块不相邻且字典序最小枚举每一块砖,如果这个位置为空,就填入字典序最小的砖块,然后将边长一格格拓展
如果当前右侧位置可以填入字典序更小的砖块,就不拓展
否则判断能否拓展并拓展#include
#include
#include
#include <al...
分类:
其他好文 时间:
2015-05-19 13:10:01
阅读次数:
120
Red and Black
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 25014
Accepted: 13502
Description
There is a rectangular room, covered with square tiles. E...
分类:
其他好文 时间:
2015-05-17 10:51:05
阅读次数:
117
Implement int sqrt(int x).Compute and return the square root of x.解题思路一: public int mySqrt(int x) { return (int)Math.sqrt(x); }神奇般的Accept...
分类:
编程语言 时间:
2015-05-16 20:24:52
阅读次数:
170
先贴一段C++标准(ISO/IEC 14882:2003):5.2.1 Subscripting:1 A postfix expression followed by an expression in square brackets is a postfix expression. One of t...
分类:
其他好文 时间:
2015-05-15 21:17:21
阅读次数:
132
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example,Given n = 3,You should return the followin...
分类:
编程语言 时间:
2015-05-15 21:05:11
阅读次数:
176
Android 开源界最伟(jian)大(zhi)高(kai)效(gua)的公司Square又向业界投下一颗重磅炸弹。推出了一个叫LeakCanary的玩意儿,可以通过简单粗暴的方式来让开发者获取自己应用的内存泄露情况。而且得益于gradle强大的可配置性,可以确保只在编译 debug 版本时才.....
分类:
其他好文 时间:
2015-05-15 13:37:19
阅读次数:
126
Sudoku
Time Limit: 2000MS
Memory Limit: 65536KB
64bit IO Format: %I64d & %I64u
Submit Status
Description
Sudoku is a very simple task. A square table with 9 rows an...
分类:
其他好文 时间:
2015-05-15 09:13:29
阅读次数:
130
没有使用过OkHttp的,可以先看OkHttp使用介绍英文版原版地址Recipes · square/okhttp Wiki同步get下载一个文件,打印他的响应头,以string形式打印响应体。响应体的 string() 方法对于小文档来说十分方便、高效。但是如果响应体太大(超过1MB),应避免适应...
分类:
Web程序 时间:
2015-05-15 01:01:53
阅读次数:
895
题目大意:
Silverland居住的人们使用方币,这种硬币的价值都是平方数。硬币的价值分别为1分、4分、9分,
…,最大为289(17^2)分。要得到10分钱,共有四种硬币组合
10个1分硬币、1个4分硬币和6个1分硬币、2个4分硬币和2个1分硬币,1个9分硬币和1个1分硬币。
现在给你一个数,问:得到这个值,共有多少种不同的硬币组合方式。
思路:
典型的母函数问题。
可列出母函数 g(x) = (1+x+x^2+x^3+…)*(1+x^4+x^8+…)*…*(1+x^289+x^578+…),用母函
...
分类:
其他好文 时间:
2015-05-14 23:55:39
阅读次数:
261
Description:In mathematics, a square number is an integer that is the square of an integer. In other words, it is the product of some integer with its...
分类:
其他好文 时间:
2015-05-13 19:25:20
阅读次数:
179