Rectangle 暴力枚举大法

- #include <cstdio>
- #include <cstring>
- #include <queue>
- #include <cmath>
- #include <algorithm>
- #include <set>
- #include <iostream>
- #include <map>
- #include <stack>
- #include <string>
- #include <vector>
- #define pi acos(-1.0)
- #define eps 1e-6
- #define fi first
- #define se second
- #define lson l,m,rt<<1
- #define rson m+1,r,rt<<1|1
- #define bug printf("******\n")
- #define mem(a,b) memset(a,b,sizeof(a))
- #define fuck(x) cout<<"["<<x<<"]"<<endl
- #define f(a) a*a
- #define sf(n) scanf("%d", &n)
- #define sff(a,b) scanf("%d %d", &a, &b)
- #define sfff(a,b,c) scanf("%d %d %d", &a, &b, &c)
- #define pf printf
- #define FRE(i,a,b) for(i = a; i <= b; i++)
- #define FREE(i,a,b) for(i = a; i >= b; i--)
- #define FRL(i,a,b) for(i = a; i < b; i++)
- #define FRLL(i,a,b) for(i = a; i > b; i--)
- #define FIN freopen("DATA.txt","r",stdin)
- #define lowbit(x) x&-x
- #pragma comment (linker,"/STACK:102400000,102400000")
- using namespace std;
- const int maxn = 1e5 + ;
- typedef long long LL;
- LL n,m,k;
- int main() {
- while(~sfff(n,m,k)){
- k=k/;
- LL ans=;
- for (int i= ;i<=n ;i++) {
- if (k-i<=) break;
- LL a=(n-i+);
- LL b=min(k-i,m);
- LL c=(m+(m-b+))*b/;
- ans+=a*c;
- }
- printf("%lld\n",ans);
- }
- return ;
- }
Rectangle 暴力枚举大法的更多相关文章
- 区间Dp 暴力枚举+动态规划 Hdu1081
F - 最大子矩形 Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Des ...
- UVA 10012 How Big Is It?(暴力枚举)
How Big Is It? Ian's going to California, and he has to pack his things, including his collection ...
- CodeForces 742B Arpa’s obvious problem and Mehrdad’s terrible solution (暴力枚举)
题意:求定 n 个数,求有多少对数满足,ai^bi = x. 析:暴力枚举就行,n的复杂度. 代码如下: #pragma comment(linker, "/STACK:1024000000 ...
- 2014牡丹江网络赛ZOJPretty Poem(暴力枚举)
/* 将给定的一个字符串分解成ABABA 或者 ABABCAB的形式! 思路:暴力枚举A, B, C串! */ 1 #include<iostream> #include<cstri ...
- HNU 12886 Cracking the Safe(暴力枚举)
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12886&courseid=274 解题报告:输入4个数 ...
- 51nod 1116 K进制下的大数 (暴力枚举)
题目链接 题意:中文题. 题解:暴力枚举. #include <iostream> #include <cstring> using namespace std; ; ; ch ...
- Codeforces Round #349 (Div. 1) B. World Tour 最短路+暴力枚举
题目链接: http://www.codeforces.com/contest/666/problem/B 题意: 给你n个城市,m条单向边,求通过最短路径访问四个不同的点能获得的最大距离,答案输出一 ...
- bzoj 1028 暴力枚举判断
昨天梦到这道题了,所以一定要A掉(其实梦到了3道,有两道记不清了) 暴力枚举等的是哪张牌,将是哪张牌,然后贪心的判断就行了. 对于一个状态判断是否为胡牌,1-n扫一遍,然后对于每个牌,先mod 3, ...
- POJ-3187 Backward Digit Sums (暴力枚举)
http://poj.org/problem?id=3187 给定一个个数n和sum,让你求原始序列,如果有多个输出字典序最小的. 暴力枚举题,枚举生成的每一个全排列,符合即退出. dfs版: #in ...
随机推荐
- javascript常用对象方法
concat:连接产生一个新数组 [1,2].concat([3,4]) >> [1, 2, 3, 4] filter:返回符合条件的一个新数组 [1,2,3,4,5].filte ...
- struts2源码分析-初始化流程
这一篇文章主要是记录struts.xml的初始化,还原struts2.xml的初始化流程.源码依据struts2-2.3.16.3版本. struts2初始化入口,位于web.xml中: <fi ...
- [Clr via C#读书笔记]Cp18 定制Attribute
Cp18 定制Attribute 意义 利用Attribute,可以声明性的给自己的代码结构创建注解,从而实现一些特殊的功能:最终在元数据中生成,这种可扩展的元数据信息可以在运行时的时候查询,从而动态 ...
- isX字符串方法
islower():返回True,如果字符串至少有一个字母,并且所有字母都是小写: 例如:>>> spam='Hello world' >>> spam.islow ...
- Python3 Tkinter-Scrollbar
1.创建 from tkinter import * root=Tk() Scrollbar(root).pack() root.mainloop() 2.设置silder的位置 from tkint ...
- 十:HDFS Short-Circuit Local Reads 短路本地读取
当client请求数据时,datanode会读取数据然后通过TCP协议发送给client.short-circuit绕过了datanode直接读取数据.short-circuit的前提是client和 ...
- 欢迎来怼--第七次Scrum会议
一.小组信息 队名:欢迎来怼 小组成员: 队长:田继平 成员:李圆圆,葛美义,王伟东,姜珊,邵朔,冉华 小组照片 二.开会信息 时间:2017/10/19 17:05~17:17,总计12min. 地 ...
- HDU 5794 A Simple Chess dp+Lucas
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5794 A Simple Chess Time Limit: 2000/1000 MS (Java/O ...
- iOS开发NSDate详解
1. 用于创建NSDate实例的类方法有 + (id)date; 返回当前时间 + (id)dateWithTimeIntervalSinceNow:(NSTimeInterval)secs; 返回以 ...
- android gradle打包常见问题及解决方案
背景: 问题: Q1: UNEXPECTED TOP-LEVEL ERROR: java.lang.OutOfMemoryError: Java heap space at com.android.d ...