BZOJ1397 : Ural 1486 Equal squares】的更多相关文章

二分答案mid,然后检验是否存在两个相同的mid*mid的正方形 检验方法: 首先对于每个位置,求出它开始长度为mid的横行的hash值 然后对于hash值再求一次竖列的hash值 将第二次求出的hash值排序,如果存在两个相同的hash值则可行 #include<cstdio> #include<algorithm> #define N 510 typedef unsigned long long ll; const ll D1=97,D2=131; int n,m,i,j,l,…
During a discussion of problems at the Petrozavodsk Training Camp, Vova and Sasha argued about who of them could in 300 minutes find a pair of equal squares of the maximal size in a matrix of size N × M containing lowercase English letters. Squares c…
Description During a discussion of problems at the Petrozavodsk Training Camp, Vova and Sasha argued about who of them could in 300 minutes find a pair of equal squares of the maximal size in a matrix of size N × M containing lowercase English letter…
题意:求给定字符矩阵中相同正方形矩阵的最大边长和这两个相同正方形的位置 第一次写字符串哈希,选两个不同的模数进行二维字符串哈希. 本来应该取模判断相等后再暴力扫矩阵来判断,但是我看到<Hash在信息学竞赛中的一类应用>中这么写道: 于是我还会再次判重吗?肯定不会!!! 于是这样写完后就调啊调,调出几个像没用unsigned long long这样的脑残错误后交上去就A了233 #include<cstdio> #include<cstring> #include<…
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1486 题意:给定一个n*m的字符矩阵,问你是否存在两个不重合(可以有交集)的正方形矩阵完全一致, 存在输出正方形的最大边长和两个正方形的左上角坐标,不存在则输出0 思路:二维字符串Hash,二分正方形的长度,然后Hash判断即可. #define _CRT_SECURE_NO_DEPRECATE #include<iostream> #include<cstdio> #i…
Search GO 说明:输入题号直接进入相应题目,如需搜索含数字的题目,请在关键词前加单引号 Problem ID Title Source AC Submit Y 1000 A+B Problem 10983 18765 Y 1036 [ZJOI2008]树的统计Count 5293 13132 Y 1588 [HNOI2002]营业额统计 5056 13607 1001 [BeiJing2006]狼抓兔子 4526 18386 Y 2002 [Hnoi2010]Bounce 弹飞绵羊 43…
A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to m…
题目链接 A. Poster time limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard output The R1 company has recently bought a high rise building in the centre of Moscow for its main office. It's time to decorate the ne…
C2. Tidying Up time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Smart Beaver is careful about his appearance and pays special attention to shoes so he has a huge number of pairs of shoes fr…
A. Far Relative's Birthday Cake time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to m…