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 1753 Flip Game(bfs)
DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceiswhiteandtheotheroneisblackandeachpieceislyingeitherit'sblackorwhitesideup.Eachroundyo
u013013910
·
2014-03-24 22:00
编程
算法
C语言
poj
bfs
USACO Palindromic
Squares
__Execution Error已解决
本地机器上测试的结果与FullAnswer一致,但提交运行就: > Run 8: Execution error: Your program had this runtime error: Illegal file open (/dev/tty). The program ran for 0.000 CPU seconds before the error. It
kaneqi
·
2014-02-18 09:00
UVALive 6602 Counting Lattice
Squares
给定一个n*m的网格,求面积为奇数的正方形有多少个.首先是n*m个面积为1的,然后剩下的要么是边长为奇数,要么被这样一个奇数边长所包围。原因如下:对于一个边长不平行于坐标抽的正方形,其边长一定是某个长方形的对角线,而且长方形长宽a,b一定是一奇数,一偶数,这样area=a^2+b^2才是奇数。所以可以对任何奇数i #include #include #include #include #
·
2014-02-17 16:00
count
usaco 1.2 Palindromic
Squares
(进制转化)
考察进制转化注意一些细节就可以了直接上代码:/* ID:whojay LANG:C++ TASK:palsquare */ #include intx[20],xlen,y[20],ylen,B; voidchange(intn) { intm; m=n; xlen=0; while(m) { x[++xlen]=m%B; m/=B; } m=n*n; ylen=0; while(m) {
u013508213
·
2014-02-04 23:00
POJ1753 Flip Game【DFS】
Accepted: 11809DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceisw
u011676797
·
2014-01-11 22:00
Palindromic
Squares
PalindromicSquaresRobKolstadPalindromesarenumbersthatreadthesameforwardsasbackwards.Thenumber12321isatypicalpalindrome.GivenanumberbaseB(2 #include #include #include usingnamespacestd; intbase; char
u012797220
·
2013-12-11 21:00
USACO
Flip Game
Accepted: 11682DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceisw
u012629369
·
2013-12-09 20:00
bfs
poj 2002
Squares
亲测不hash会MLE==SquaresTimeLimit:3500MSMemoryLimit:65536KTotalSubmissions:14856Accepted:5632DescriptionAsquareisa4-sidedpolygonwhosesideshaveequallengthandadjacentsidesform90-degreeangles.Itisalsoapolygo
locusxt
·
2013-12-04 19:00
poj
USACO Section 1.2 Palindromic
Squares
/* ID:lucien23 PROG:palsquare LANG:C++ */ #include #include #include #include #include #include usingnamespacestd; stringnum2string(intnum,intbaseNum); intmain() { ifstreaminfile("palsquare.in"); ofs
LucienDuan
·
2013-11-25 21:00
Algorithm
C++
USACO
ZOJ 3213 Beautiful Meadow 解题报告(插头DP)
BeautifulMeadowTimeLimit: 5Seconds MemoryLimit: 32768KBTom'sMeadowTomhasameadowinhisgarden.Hedividesitinto N * M
squares
.Initiallyallthesquaresarecoveredwithgrassandtheremaybesomesquarescannotbemo
kbdwo
·
2013-11-13 17:00
dp
插头DP
POJ 1753 Flip Game
Accepted: 11333DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceisw
Magic____
·
2013-10-04 15:00
hdu4758 Walk Through
Squares
AC自动机(trie图)DP
提议大致是给n,m,再给两个非空的不相同的只包含R或D字符串s1,s2,问用n个R,m个D可以组成多少种包含s1,s2的字符串。大致思路的话,先根据两个字符串构造trie图,其实就是把失配函数优化掉的ac自动机。之后用dp[i][x][y][k]表示在自动机上状态i,用x个R,y个D,包含s1,s2的状态.令初值dp[0][0][0][0]=1,向上DP,最后统计dp[i][n][m][3]
yanglei040
·
2013-10-02 10:00
基于学习的使用核偏最小二乘法的图像超分辨率算法(Learning-based super resolution using kernel partial least
squares
)
前记 此文章为本人在学习图像处理课程时翻译的某篇SCI论文。原文标题作者为:WeiWu,ZhengLiu,XiaoHaiHe.“Learning-basedsuperresolutionusingkernelpartialleastsquares”.ImageandVisionComputing,2011,29(6)(SCI检索影响因子1.53D级期刊)。
jiximeng123
·
2013-09-29 16:00
kernel
图像处理
核偏最小二乘法
基于学习的超分辨率
残差图像
POJ 1753
Accepted: 11308DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceisw
doufei_ccst
·
2013-09-28 17:00
hdu 4758 Walk Through
Squares
(AC自动机+DP,4级)
WalkThroughSquaresTimeLimit:4000/2000MS(Java/Others) MemoryLimit:65535/65535K(Java/Others)TotalSubmission(s):234 AcceptedSubmission(s):58ProblemDescription Onthebeamingdayof60thanniversaryofNJU
nealgavin
·
2013-09-22 13:00
POJ 2002
Squares
给出N个点,判断可以组成多少个正方形。最后输出正方形的个数。思路:枚举每两个点,计算出另外的两个点,若另外两点存在则正方形存在。这样得到的结果是最终结果的二倍,因为每一个正方形均累加了两次。另外两点的计算方法:设AC和BD的交点O的坐标为(X0,Y0),则有X0=(X1+X3)/2,Y0=(Y1+Y3)/2;从图上可以看出:X2-X0=Y3-Y0,Y2-Y0=X0-X3;将上述四式合并得:X2=(
u012161037
·
2013-09-18 15:00
HDU 1264 Counting
Squares
题意就是给你多个矩形,然后算出这些矩形所框出来的总面积,框过多次的按一次算。但是题目给的是二维的,线段树只是解决一维的问题比较简单。题目数据范围为0~100,所以我就建了一百棵线段树,这样就可以转化成一维的问题来解决了。-_-||结果跑了70+ms 不知道还能再怎么优化……HDU里面有好多0ms的大神……1#include 2#include 3 4intst[110][10100]; 5
u012161037
·
2013-09-18 15:00
UVa:11407
Squares
简单动规。 dp[i]表示i的最小表示数目。如果i可以被开方dp[i]=1;否则dp[i]=min{dp[j]+dp[i-j]}(0 #include #include #include #include #defineMAXN10000 usingnamespacestd; intdp[MAXN+1]; intmain() { for(inti=1;i<=MAXN;++i)
kkkwjx
·
2013-09-01 10:00
动态规划
UVALive 4728
Squares
(旋转卡壳求凸包直径)
给出平面上的n个矩形,求所有顶点对中距离的最大值。显然最大距离的顶点对在凸包上,而求凸包直径,当然用旋转卡壳了。。。#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define
diary_yang
·
2013-08-27 10:00
POJ 2002
Squares
SquaresTimeLimit: 3500MS MemoryLimit: 65536KTotalSubmissions: 14440 Accepted: 5441DescriptionAsquareisa4-sidedpolygonwhosesideshaveequallengthandadjacentsidesform90-degreeangles.Itisalsoapolygonsuchth
HRHACMER
·
2013-08-23 18:00
Codeforces Beta Round #47 / 50A Domino piling(贪心)
Atimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenarectangularboardof M × N
squares
.Also
synapse7
·
2013-08-21 18:00
ACM
codeforces
位运算-BFS-Flip Game-POJ 1753
DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceiswhiteandtheotheroneisblackandeachpieceislyingeitherit'sblackorwhitesideup.Eachroundyo
gaotong2055
·
2013-08-13 12:00
UVA 1453 -
Squares
点击打开链接 题意: 给你一大波正方形左下角的点及其边长 实际上就是40W个点 然后求平面上最远两点的距离的平方 旋转卡壳模板题 //大白p263 #include <cmath> #include <cstdio> #include <cstring> #include <string> #include &l
·
2013-08-12 19:00
uva
UVA 1453 -
Squares
点击打开链接题意:给你一大波正方形左下角的点及其边长实际上就是40W个点然后求平面上最远两点的距离的平方旋转卡壳模板题 //大白p263 #include #include #include #include #include #include #include #include #include #include usingnamespacestd; constdoubleeps=1e-10;/
lfj200411
·
2013-08-12 15:00
POJ 2002
Squares
Hash
题意:给定n个点下面n行表示n个坐标,问最多能组成几个正方形这里正方形是:遍历其中2个点,判断另外2个点是否存在//下面的公式来自http://blog.csdn.net/lyy289065406/article/details/6647405已知:(x1,y1) (x2,y2)则:x3=x1+(y1-y2) y3=y1-(x1-x2)x4=x2+(y1-y2) y4=y2-(x1-x2)或x3=
qq574857122
·
2013-08-03 22:00
hash
poj
Palindromic
Squares
(枚举)
Palindromic
Squares
Rob Kolstad Palindromes are numbers that read the same forwards as backwards.
Simone_chou
·
2013-07-31 17:00
ROM
poj1753
Accepted:10864DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceiswhite
u010422038
·
2013-07-29 09:00
USACO Section 1.2.4 Palindromic
Squares
既然是各种进制,那就写个函数解决进制转换的问题吧,相信这个不难吧,但应该注意的是大于10的进制应该有字母出现的,多以多处理一步吧我写的进制转换的函数名字是jinzhi(),有两个参数,第一个是要转换的数,第二个是要转换成哪种进制的,返回的是字符串,应为转换过后的那个数用十进制表示很可能溢出(事实上肯定会溢出)既然有回文判断,那就写个函数判断是不是回文就好了,简单!下面的步骤就好办了,1-300以内
zhuihunmiling
·
2013-07-23 10:00
USACO 1.2.4 Palindromic
Squares
回文平方数
PalindromicSquaresRobKolstadPalindromesarenumbersthatreadthesameforwardsasbackwards.Thenumber12321isatypicalpalindrome.GivenanumberbaseB(2 #include #include #include #include #include usingnamespacest
caizi1991
·
2013-07-22 19:00
hdu1264Counting
Squares
(二维线段树水过)
->题目请戳这里 #include #include #include usingnamespacestd; constintN=105; structnode { intnum; intarea; inttree[N>1; build(num>1; if(rmid) insert(num>1; build(num>1; if(x2mid) insert(numx2) { x1^=x2; x2^=
ophunter
·
2013-06-19 23:00
数据结构
线段树
LA4728
Squares
思路:用旋转卡壳求最远点对。#include #include #include #include #include #include #definenext(i)((i+1)%n) usingnamespacestd; constdoublemaxn=401000; constdoubleeps=1e-8; intdcmp(doublex){ if(fabs(x)0)return1; retu
wangwenhao00
·
2013-06-01 21:00
OpenCV Demo-
squares
先看看效果#include"stdafx.h" #include"opencv2/opencv.hpp" #include #include #include usingnamespacecv; usingnamespacestd; staticvoidhelp() { coutpt1andfrompt0->pt2 staticdoubleangle(Pointpt1,Pointpt2,
soidnhp
·
2013-05-27 10:00
opencv
POJ 1753
Accepted: 10409DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceisw
zkzxmzk
·
2013-05-23 21:00
ACM
bfs
USACO Palindromic
Squares
源码
阅读更多这题很容易的,依然是暴力搜索,好吧,这一章都叫completesearch要点就两个,一个是进制转换,一个是ASCII码转换(当然你要想用数组来搞也是没什么问题的)难道就是在告诉你,暴力搜索才是你最需要care的么?!下面上我的代码:/*ID:bbsunch2PROG:palsquareLANG:C++*/#include#include#include#include#includeus
bbsunchen
·
2013-04-23 14:00
USACO
Algorithm
USACO Palindromic
Squares
源码
这题很容易的,依然是暴力搜索,好吧,这一章都叫complete search 要点就两个,一个是进制转换,一个是ASCII码转换(当然你要想用数组来搞也是没什么问题的) 难道就是在告诉你,暴力搜索才是你最需要care的么?! 下面上我的代码: /* ID: bbsunch2 PROG: palsquare LANG: C++ */ #include <iostream>
bbsunchen
·
2013-04-23 14:00
Algorithm
USACO
Palindromic
Squares
PalindromicSquaresRobKolstadPalindromesarenumbersthatreadthesameforwardsasbackwards.Thenumber12321isatypicalpalindrome.GivenanumberbaseB(2 usingnamespacestd; intmain(intargc,constchar*argv[]) { ofstre
jimzhai
·
2013-04-20 21:00
POJ 2002
Squares
DescriptionAsquareisa4-sidedpolygonwhosesideshaveequallengthandadjacentsidesform90-degreeangles.Itisalsoapolygonsuchthatrotatingaboutitscentreby90degreesgivesthesamepolygon.Itisnottheonlypolygonwithth
lphy2352286B
·
2013-04-16 13:00
UVA 1453
Squares
大意略。思路:十万个点,如果直接枚举顶点的话会超时。可以求出凸包后,然后再枚举两个顶点,极限情况下也是O(n^2),竟然被我水过去了。正解是通过旋转卡壳的方法求凸包顶点之间的最小距离。先贴暴力代码,然后去学习旋转卡壳:http://cgm.cs.mcgill.ca/~orm/rotcal.frame.html#include #include #include #include #incl
Wall_F
·
2013-04-05 19:00
USACO Magic
Squares
解题报告
在发现8!=40320之后,我发现空间不是影响因素了。只要不重复运算,时间和空间都是足够的。值得借鉴的地方:1.对于转换的处理:/*thesetoftransformations,inorder*/staticinttforms[3][8]={{8,7,6,5,4,3,2,1},{4,1,2,3,6,7,8,5}, {1,7,2,4,5,3,6,8}};这里是另外一种思路,处理起来相对更简单些。思
thestoryofsnow
·
2013-04-02 15:00
【源代码】Image Deformation Using Moving Least
Squares
算法的实现
在参考https://code.google.com/p/imgwarp-opencv/的基础上,把mls图像变形算法进行了实现,但感觉效果不是很好。在此贴出源代码,希望有人其同探讨与对其改进。 原图像
wqvbjhc
·
2013-04-01 10:00
poj1753――Flip Game
原题:DescriptionFlipgameisplayedonarectangular4x4fieldwithtwo-sidedpiecesplacedoneachofits16
squares
.Onesideofeachpieceiswhiteandtheotheroneisblackandeachpieceislyingeitherit'sblackorwhitesideup.Eachroun
bingsanchun
·
2013-03-28 14:00
java
开发技术
USACO Section 1.2 Palindromic
Squares
大意略。/* ID:g0feng1 LANG:C++ TASK:palsquare */ #include #include #include #include #include #include #include #include #include #include usingnamespacestd; ofstreamfout("palsquare.out"); ifstreamfin("
Wall_F
·
2013-03-26 22:00
Squares
timelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyahasfoundapieceofpaperwithacoordinatesystemwrittenonit.Thereare n distinctsquaresdrawninthiscoordinatesy
jj12345jj198999
·
2013-03-20 22:00
Ruby中的类变量与类方法
首先,我们通过一个实例来观察类变量与类方法: class Square def initialize @@number_of_
squares
= define?
sanqianyuejia
·
2013-02-27 21:06
类变量
类方法
A. Domino piling
timelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenarectangularboardof M × N
squares
.Alsoyouaregivenanunlimitednumberofstandarddominopiecesof
jj12345jj198999
·
2013-02-27 16:00
Euler_Problem6
Problem 6 The sum of the
squares
of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385
tosee
·
2013-02-27 10:00
算法
Project Euler
和的平方与平方和之差
BIT1033 POJ 2002
Squares
SET解法(此法在POJ会TLE,哈希解法在后面)题目的意思是给n个点,让在n个点中找四个点为正方形的方案数,同四个点旋转,反转什么的只能算一个一共有1000个点如果直接枚举是1000×1000×1000×1000的复杂度每次枚举两个点,再用两个点算出另两个点的坐标,看这两个点的坐标存不存在这样的复杂度就是1000×1000×log(1000)因为我是用set实现查找的已知1,2点的坐标,这里我们
zhangwei1120112119
·
2013-01-31 19:00
哈希
Usaco:Palindromic
Squares
简单的进制转换/* ID:JangLawrence PROG:palsquare LANG:C++ */ #include #include #include #include usingnamespacestd; intn; chara[]={"0123456789ABCDEFGHIJKLMN"}; voiddfs(intx) { if(x>=n)dfs(x/n); putchar(a[x%n]
Lawrence_Jang
·
2013-01-18 13:00
Double
Squares
(Python版)
Description:Adouble-squarenumberisanintegerXwhichcanbeexpressedasthesumoftwoperfectsquares.Forexample,10isadouble-squarebecause10=3^2+1^2.Yourtaskinthisproblemis,givenX,determinethenumberofwaysinwhich
lxf310
·
2013-01-01 19:00
Palindromic
Squares
PalindromicSquaresRobKolstadPalindromesarenumbersthatreadthesameforwardsasbackwards.Thenumber12321isatypicalpalindrome.GivenanumberbaseB(2 #include #include #include //#definefincin //#definefoutcout
pucca6
·
2012-12-18 00:00
上一页
15
16
17
18
19
20
21
22
下一页
按字母分类:
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
其他