左上角和右下角不四连通等价于左下角和右上角八连通 枚举正方形的左上角,先二分出最大的边长,使得里面不含障碍物 然后再二分出最小的边长,使得两部分连通,用前缀和判断 这题WA了好久…一直对拍都没问题…于是去看原题,发现有SPJ… 然后改了个枚举姿势就过了… #include<cstdio> #define N 1510 int n,m,i,j,dx[8]={-1,-1,-1,0,0,1,1,1},dy[8]={-1,0,1,-1,1,-1,0,1},x[N*N],y[N*N],h,t,sum[3…
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…
NEERC2012 A - Addictive Bubbles 题目描述:有一个\(n \times m\)的棋盘,还有不同颜色的棋子若干个,每次可以消去一个同种颜色的联通块,得到的分数为联通块中的棋子数的平方,消掉后高处的棋子会落到下面.设计一个摆法,使得在最优策略下能得到最多的分数. solution 同种颜色的棋子摆在一起即可. 时间复杂度:\(O(nm)\) B - Blind Problem Solving 题目描述:有\(n\)个物品,一个容量为\(c\)的背包,每个物品的大小为\(…
vor: 来自拉丁动词vorare,指to eat,-ivorous指吃某种食物的eater.carn肉,肉欲+vore吃→吃肉的:carnival狂欢节,谢肉节voracious a 狼吞虎咽的(vor+acious多…..的--吃多的) voracity n 贪食(vor+acilty) devour v 吞吃(de下去+vour[=vor]→吃下去→吞吃) omnivorous a 杂食性的(omni全部+vor+oue→什么都吃→杂食性的) herbivorous a 食草的(herbi…
D. Theseus and labyrinth 题目连接: http://www.codeforces.com/contest/676/problem/D Description Theseus has just arrived to Crete to fight Minotaur. He found a labyrinth that has a form of a rectangular field of size n × m and consists of blocks of size 1…
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Theseus has just arrived to Crete to fight Minotaur. He found a labyrinth that has a form of a rectangular field of size n × m and consists of b…
Labyrinth Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1507    Accepted Submission(s): 520 Problem Description 度度熊是一只喜欢探险的熊,一次偶然落进了一个m*n矩阵的迷宫,该迷宫只能从矩阵左上角第一个方格开始走,只有走到右上角的第一个格子才算走出迷宫,每一次只能走一格,…
1145. Rope in the Labyrinth Time limit: 0.5 secondMemory limit: 64 MB A labyrinth with rectangular form and size m × n is divided into square cells with sides' length 1 by lines that are parallel with the labyrinth's sides. Each cell of the grid is e…
[POJ1383]Labyrinth 试题描述 The northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divided into square blocks, each of them either filled by rock, or free. There is also a little hook on the floor in the center…
Labyrinth Time limit: 1.0 secondMemory limit: 64 MB Administration of the labyrinth has decided to start a new season with new wallpapers. For this purpose they need a program to calculate the surface area of the walls inside the labyrinth. This job…