ACM: SCU 4440 Rectangle - 暴力】的更多相关文章

 SCU 4440 Rectangle Time Limit:0MS     Memory Limit:0KB     64bit IO Format:%lld & %llu  Practice Description Rectangle frog has a piece of paper divided into nn rows and mm columns. Today, she would like to draw a rectangle whose perimeter is not gr…
题目链接:http://acm.scu.edu.cn/soj/problem/4440/ 题目大意:给一个n*m的方格,求周长小于等于k的矩形有多少个. 解题思路:我之前直接暴力,显然超时,所以后来发现,可以用等差数列的求前n项和公式来代替一层for循环,这样就只有一重循环了,不会超时. AC代码: #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #incl…
SCU - 4440 Rectangle Time Limit: Unknown   Memory Limit: Unknown   64bit IO Format: %lld & %llu Submit Status Description Rectangle frog has a piece of paper divided into n rows and m columns. Today, she would like to draw a rectangle whose perimeter…
SCU 4437  Carries Time Limit:0MS     Memory Limit:0KB     64bit IO Format:%lld & %llu  Practice  Description Carries frog has nn integers a1,a2,…,ana1,a2,…,an, and she wants to add them pairwise. Unfortunately, frog is somehow afraid of carries (进位).…
转载请声明出处:http://www.cnblogs.com/kevince/p/3887827.html    ——By Kevince 首先声明一下,这里的规律指的是循环,即找到最小循环周期. 这么一说大家心里肯定有数了吧,“不就是next数组性质的应用嘛”,没错,正是如此. 在ACM的比赛中有些时候会遇到一些题目,可以或必须通过找出数据的规律来编写代码,这里我们专门来讨论下 如何运用KMP中next数组的性质 来寻找一个长数组中的最小循环周期. 先来看一道题 ZOJ 3785 What d…
 SCU 4438 Censor Time Limit:0MS     Memory Limit:0KB     64bit IO Format:%lld & %llu  Practice Description Censor frog is now a editor to censor so-called sensitive words (敏感词). She has a long text pp. Her job is relatively simple -- just to find the…
frog has a piece of paper divided into n rows and m columns. Today, she would like to draw a rectangle whose perimeter is not greater than k.     There are 8 (out of 9) ways when n=m=2,k=6   Find the number of ways of drawing.       枚举长度  然后算出宽度的取值范围…
[转] POJ推荐50题以及ACM训练方案 -- : 转载自 wade_wang 最终编辑 000lzl POJ 推荐50题 第一类 动态规划(至少6题, 和 必做) 和 (可贪心) (稍难) 第二类 搜索(至少4题) (稍难,也可并查集) 第三类 贪心(至少2题) (难) 第四类 最短路 (至少3题) Bellman-Ford (难) 第五类 最小生成树 (至少2题, 而且 Prim 和 Kruskal 至少各用一次) 第六类 最大流 (至少2题) (最小费用最大流) (难) 第七类 二分图…
4436: Easy Math Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.scu.edu.cn/soj/problem.action?id=4436 Description Given n integers a1,a2,…,an, check if the sum of their square root a1+a2+…+an is a integer. Input The input consists of multiple…
浙江大学(ZJU):http://acm.zju.edu.cn/ 北京大学(PKU):http://acm.pku.edu.cn/JudgeOnline/ 同济大学(TJU):http://acm.tongji.edu.cn/ 宁波理工(NIT):http://acm.nit.net.cn 中国地质大学(CUG):http://lab.cug.edu.cn/COJ/ 中国科技大学(USTC):http://acm.ustc.edu.cn/ 吉林大学(jlu):http://acm.jlu.edu…