E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
Squares
POJ 1038 Bug Integrated Inc(状态压缩DP)
Each chip consists of six unit
squares
arranged in
·
2015-10-30 11:42
integrate
POJ 2411 Mondriaan's Dream (状压DP)
Memory Limit: 65536K Total Submissions: 9135 Accepted: 5280 Description
Squares
·
2015-10-28 09:48
poj
uva 1629
seconds A rectangular cake with a grid of m * n <tex2html_verbatim_mark>unit
squares
·
2015-10-28 07:54
uva
USACO: Section 1.2 -- PROB Palindromic
Squares
Source Code Lesson Learned: 1. Pseudocode is really efficient for designing routines. And please stay calm and write down all the details in pseudocode before coding. 2. During design, all the known
·
2015-10-27 16:10
USACO
UVa-201
Squares
以前做的题,写的丑,肯定可以优化,但是做过的题不想再看了,直接粘代码。 #include<iostream> #include<cstdio> #include<cstring> #include<string> using namespace std; bool fuc(int x,int y,int i); int h[20][20
·
2015-10-27 14:26
uva
数值优化-梯度下降法
NG的课件1,引出常用的优化方法梯度下降法(gradient descent) 对于 ordinary least
squares
regression, cost
·
2015-10-27 13:22
优化
HDU1198水管并查集Farm Irrigation
The farm land is a rectangle, and is divided into a lot of samll
squares
.
·
2015-10-27 13:35
HDU
[leetcode] 279 Perfect
Squares
(DP,四平方和定理)
1. 四平方和定理定理表明 每个正整数均可表示为4个整数的平方和。也就是说这个题的答案dp(n+1,0); for(inti=0;i
NK_test
·
2015-10-24 21:00
LeetCode
C++
dp
背包
四平方和定理
Codeforces Beta Round #18 (Div. 2 Only) C. Stripe 前缀和
题目连接 http://codeforces.com/problemset/problem/18/C Description Once Bob took a paper stripe of n
squares
·
2015-10-23 09:48
codeforces
ZOJ 2067 White Rectangles
You are given a chessboard made up of N
squares
by N
squares
with equal size.
·
2015-10-23 08:50
ZOJ
Perfect
Squares
题解:求平方和等于n的数的最小个数思路:动态规划解决状态转移方程:dp[i+j*j]==min(dp[i+j*j],dp[i]+1);classSolution{ public: intnumSquares(intn){ vectornum(n+1,INT_MAX); for(inti=1;i*i<=n;i++){ num[i*i]=1; } for(inti=1;i<=n;i++){ for(i
JANESTAR
·
2015-10-08 19:00
poj 1753 Flip Game 【高斯消元 + 状压枚举自由变元】
Accepted: 15487DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceisw
chenzhenyu123456
·
2015-10-06 14:00
[LeetCode]Perfect
Squares
Givenapositiveinteger n,findtheleastnumberofperfectsquarenumbers(forexample, 1,4,9,16,...)whichsumto n.Forexample,given n = 12,return 3 because 12=4+4+4;given n = 13,return 2 because 13=4+9.动态规划。class
CiaoLiang
·
2015-09-30 10:00
LeetCode----Perfect
Squares
PerfectSquaresGivenapositiveinteger n,findtheleastnumberofperfectsquarenumbers(forexample, 1,4,9,16,...)whichsumto n.Forexample,given n = 12,return 3 because 12=4+4+4;given n = 13,return 2 because 13=
whiterbear
·
2015-09-23 19:00
LeetCode
dp
动态规划
*LeetCode-Perfect
Squares
本来以为可以像combinationsum一样用backtracking,结果超时了用dp要想清楚每个位置的数字是如何得来的这个位置时min(dp[i+j*j],dp[i]+1)第一个代表就是原来的值,第二个代表用i+j*j来组成n注意javaarrayinitialize用fill其次要注意两层循环的边界publicclassSolution{ publicintnumSquares(intn)
bsbcarter
·
2015-09-22 01:00
LeetCode -- Perfect
Squares
题目描述Givenapositiveintegern,findtheleastnumberofperfectsquarenumbers(forexample,1,4,9,16,...)whichsumton.Forexample,givenn=12,return3because12=4+4+4;givenn=13,return2because13=4+9.Credits:Specialthanks
_iorilan
·
2015-09-19 16:57
LeetCode
数据结构与算法
LeetCode -- Perfect
Squares
题目描述Givenapositiveintegern,findtheleastnumberofperfectsquarenumbers(forexample,1,4,9,16,...)whichsumton.Forexample,givenn=12,return3because12=4+4+4;givenn=13,return2because13=4+9.Credits:Specialthanks
csharp25
·
2015-09-19 16:00
[LeetCode 279] Perfect
Squares
Givenapositiveintegern,findtheleastnumberofperfectsquarenumbers(forexample,1,4,9,16,...)whichsumton.Forexample,givenn=12,return3because12=4+4+4;givenn=13,return2because13=4+9.solution:similarto0/1knap
sbitswc
·
2015-09-18 13:00
LeetCode
dp
HDU 1264 Counting
Squares
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1264题意:求矩形面积并思路:做过好几次了,还算熟练……就是给出的点不一定是正对角线的点坑了好久#include #include #include #include #definemaxn1000300 usingnamespacestd; structTree { intl,r,date,tsum
csdn364988181
·
2015-09-17 23:00
leetcode Perfect
Squares
题目链接思想动态规划:record[i]=Math.min(record[i],record[i-j*j]+record[j*j]);代码publicclassSolution{ publicintnumSquares(intn){ intrecord[]=newint[n+1]; record[0]=0; record[1]=1; for(inti=2;i=1;j--) { if(j*j==i)
bleuesprit
·
2015-09-15 11:00
Leetcode:279Perfect
Squares
题目出处:Leetcode:279PerfectSquares题目描述:Givenapositiveintegern,findtheleastnumberofperfectsquarenumbers(forexample,1,4,9,16,...)whichsumton.Forexample,givenn=12,return3because12=4+4+4;givenn=13,return2be
u010668907
·
2015-09-11 18:00
LeetCode
算法
Squares
perfect
LeetCode——Perfect
Squares
题目描述:将数字n,分解成k个平方数之和。如12=4+4+4,13=9+4。求k的最小值。 题目解法:初读题目,发现如果n本身就是平方数最完美不过了,这样直接求得k=1。但是事情并不是这样。比如13,其平方根为3.6左右,不是平方数。那么,先尝试将其分为9(3的平方)+4,然后再尝试对4进行分解,发现4恰巧是完全平方数,则13结果为9+4,k=2;对于12,其平方根为3.x左右,不是平方数,
canglingye
·
2015-09-11 10:00
LeetCode
算法
OJ
Squares
perfect
[leetcode 279]Perfect
Squares
Givenapositiveinteger n,findtheleastnumberofperfectsquarenumbers(forexample, 1,4,9,16,...)whichsumto n.Forexample,given n = 12,return 3 because 12=4+4+4;given n = 13,return 2 because 13=4+9.Credits:Sp
ER_Plough
·
2015-09-11 09:00
LeetCode
C++
Squares
perfect
279
USACO 1.2 Palindromic
Squares
(进制转换)
#include #defineDEBUG0 #defineTESTCASES9 #defineSIZE_CHARS17 char*digits="0123456789ABCDEFGHIJK"; intbase; voidtransform(intdecimalNum,charnumStr[],int*len){ intquotient=0; intnumOfChars=0; while((
tiutiu2011
·
2015-09-10 21:00
进制转换
USACO
1.2
Palindromic
Squares
leetcode 279: Perfect
Squares
PerfectSquaresTotalAccepted:605TotalSubmissions:1956Givenapositiveintegern,findtheleastnumberofperfectsquarenumbers(forexample,1,4,9,16,...)whichsumton.Forexample,givenn=12,return3because12=4+4+4;give
xudli
·
2015-09-10 06:00
[CareerCup] 7.5 A Line Cut Two
Squares
in Half 平均分割两个正方形的直线
7.5Giventwosquaresonatwo-dimensionalplane,findalinethatwouldcutthesetwosquaresinhalf.Assumethatthetopandthebottomsidesofthesquarerunparalleltothex-axis这道题给了我们两个正方形,让我们求一条可以讲这两个正方形平均分为两个部分的直线,前提是两个正方形
Grandyang
·
2015-09-01 07:00
hdu 3524 Perfect
Squares
推公式求逆元
PerfectSquaresTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):501 AcceptedSubmission(s):272ProblemDescriptionAnumberxiscalledaperfectsquareifthereexist
wust_ZJX
·
2015-08-30 23:00
【索引】Geometric Algorithms in 2D::Examples
Geometry::GeometricAlgorithmsin2D::Examples10652-BoardWrapping11168-Airport10256-TheGreatDivide1453-
Squares
1396
u011328934
·
2015-08-27 12:00
Squares
POJ 2002
TimeLimit:3500MS MemoryLimit:65536KTotalSubmissions:17668 Accepted:6736DescriptionAsquareisa4-sidedpolygonwhosesideshaveequallengthandadjacentsidesform90-degreeangles.Itisalsoapolygonsuchthatrotatinga
JSPang
·
2015-08-22 20:00
uva 1453 -
Squares
(旋转卡壳)
题目链接:uva1453-
Squares
旋转卡壳裸题。
u011328934
·
2015-08-21 22:00
POJ 1753 Flip Game (BFS)
DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceiswhiteandtheotheroneisblackandeachpieceislyingeitherit'sblackorwhitesideup.Eachroundyo
Misdom_Tian_Ya
·
2015-08-20 19:00
HDU 1264 Counting
Squares
(哈希表||离散化)
CountingSquaresTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):1505AcceptedSubmission(s):767ProblemDescriptionYourinputisaseriesofrectangles,oneperline.Eachre
Sterben_Da
·
2015-08-19 21:00
Flip Game(POJ_1753)
DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceiswhiteandtheotheroneisblackandeachpieceislyingeitherit
highmath_Final
·
2015-08-18 16:00
Poj 2002
Squares
(二分&&STL)
SquaresTimeLimit:3500MS MemoryLimit:65536KTotalSubmissions:17554 Accepted:6678DescriptionAsquareisa4-sidedpolygonwhosesideshaveequallengthandadjacentsidesform90-degreeangles.Itisalsoapolygonsuchthatro
Grit_ICPC
·
2015-08-10 20:00
poj
二分
poj1753 Flip Game DFS,枚举
Accepted:15058DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceiswhite
became_a_wolf
·
2015-08-06 21:00
Squares
SquaresTimeLimit:3500MSMemoryLimit:65536KTotalSubmissions:17462Accepted:6634DescriptionAsquareisa4-sidedpolygonwhosesideshaveequallengthandadjacentsidesform90-degreeangles.Itisalsoapolygonsuchthatrota
huayunhualuo
·
2015-08-04 11:00
URAL 1486 Equal
Squares
二维字符串Hash + 邻接表分组
题目大意:就是现在给出一个N*M的字符串矩阵,只包含小写字母(1 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using
u013738743
·
2015-07-30 23:00
equal
Squares
ural
二维字符串Hash
1486
POJ 3347 && HDU 2417 Kadj
Squares
(计算几何)
Description给予n个正方形,要求45°角放置,最左边的正方形紧贴Y轴,所有的正方形的下面的端点都在X轴上。然后按照正方形不能交错但要尽可能的挨着的原则,摆放,最后输出从上往下看能看到的正方形的编号Input多组用例,每组用例第一行为正方形个数n,第二行n个数表示每个正方形的边长,以n=0结束输入Output对于每组用例,输出最后从上往下看能看到的正方形编号SampleInput43514
V5ZSQ
·
2015-07-28 11:00
POJ 3076 Sudoku
DescriptionASudokugridisa16x16gridofcellsgroupedinsixteen4x4
squares
,wheresomecellsarefilledwithlettersfromAtoP
jtjy568805874
·
2015-07-24 19:00
poj
dlx
Squares
-暴力枚举或者二分
B- SquaresTimeLimit:3500MS MemoryLimit:65536KB 64bitIOFormat:%I64d&%I64uSubmit Status Practice POJ2002DescriptionAsquareisa4-sidedpolygonwhosesideshaveequallengthandadjacentsidesform90-degreea
qq_18661257
·
2015-07-24 17:00
foodfill 八连块问题
John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100)
squares
·
2015-07-23 20:00
OO
种子填充找连通块 floodfill
John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100)
squares
·
2015-07-23 10:00
OO
python特殊函数之lambda和map
lambda表达式返回一个函数对象map(function,sequence),把sequence中的值逐个传给function,返回一个包含函数执行结果的list例子:
squares
=list(map
klrjkert
·
2015-07-20 15:06
python
map
lambda
python特殊函数之lambda和map
lambda表达式返回一个函数对象map(function,sequence),把sequence中的值逐个传给function,返回一个包含函数执行结果的list例子:
squares
=list(map
klrjkert
·
2015-07-20 15:06
python
map
lambda
Ohana Cleans Up
Matsumae is trying to clean a room, which is divided up into an n by n grid of
squares
·
2015-07-18 09:00
HANA
poj 1753 Flip Game
Accepted:14693DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceiswhite
Code_KK
·
2015-06-28 21:00
poj
codeforces B. Ohana Cleans Up
Matsumae is trying to clean a room, which is divided up into an n by n grid of
squares
·
2015-06-26 00:00
codeforces
Flip Game Poj1753
Accepted: 14686DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceisw
Grit_ICPC
·
2015-06-23 14:00
bfs
Google Interview - Integers as Sum of
Squares
给一个整数,表示成n个整数的平方和,n最小,求n。10017 = 100^2 + 4^2 + 1 --> n = 3 这道题的快速解法要牵扯到数学定理了。 Lagrange's four-square theorem Every natural number can be represented as the sum of four integ
yuanhsh
·
2015-06-19 15:00
interview
Google Interview - Integers as Sum of
Squares
给一个整数,表示成n个整数的平方和,n最小,求n。10017 = 100^2 + 4^2 + 1 --> n = 3 这道题的快速解法要牵扯到数学定理了。 Lagrange's four-square theorem Every natural number can be represented as the sum of four integ
yuanhsh
·
2015-06-19 15:00
interview
上一页
13
14
15
16
17
18
19
20
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他