ACM思维题训练集合
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).

A group of six numbers (a, b, c, d, x0, y0), where 0 ≤ a, b, c, d, is a cross, and there is a set of cells that are assigned to it. Cell (x, y) belongs to this set if at least one of two conditions are fulfilled:

|x0 - x| ≤ a and |y0 - y| ≤ b
|x0 - x| ≤ c and |y0 - y| ≤ d
The picture shows the cross (0, 1, 1, 0, 2, 3) on the grid 3 × 4.
Your task is to find the number of different groups of six numbers, (a, b, c, d, x0, y0) that determine the crosses of an area equal to s, which are placed entirely on the grid. The cross is placed entirely on the grid, if any of its cells is in the range of the grid (that is for each cell (x, y) of the cross 1 ≤ x ≤ n; 1 ≤ y ≤ m holds). The area of the cross is the number of cells it has.

Note that two crosses are considered distinct if the ordered groups of six numbers that denote them are distinct, even if these crosses coincide as sets of points.

Input
The input consists of a single line containing three integers n, m and s (1 ≤ n, m ≤ 500, 1 ≤ s ≤ n·m). The integers are separated by a space.

Output
Print a single integer — the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid.

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

Examples
Input
2 2 1
Output
4
Input
3 4 5
Output
4
Note
In the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).

In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).

这个题我就贴个代码吧,从10.00多做到了2.00多还没读懂这题要干什么,花了无数张图,题解我都看了,我真的不知道这个题的意思,还做个屁呀。

#include <bits/stdc++.h>
using namespace std;
int n, m, s, r;
long long f(int h, int w) { return (n - h + 1) * (m - w + 1); }
long long ans;
int main()
{scanf("%d%d%d", &n, &m, &s);ans = 0;44for (int i = 1; i <= n; i += 2){  for (int j = 1; j <= m && (r = s - i * j) >= 0; j += 2){if (r == 0){ans += ((i + 1) * (j + 1) / 2 - 1) * f(i, j);}elsefor (int k = 1; k < j; k += 2)if (r % (2 * k) == 0 && i + r / k <= n)ans += 2 * f(i + r / k, j);}}cout << ans << endl;return 0;
}

CF--思维练习-- CodeForces - 215C - Crosses(思维题)相关推荐

  1. codeforces 有意思的思维题 1 ~ 15

    codeforces 思维题 1.给定数组,求满足i < j and ai * aj = i + j的数对数量 2.第 i 步向前跳 i 步或后退 1 步 3.给两个点,求正方形的另两个点 4. ...

  2. CF 1567 C. Carrying Conundrum(思维)

    CF 1567 C. Carrying Conundrum(思维) 题目大意: 题目大意很有意思,就是一个小孩他不会列式相加,把进位加到了该位左侧的第二位上,现在给出结果,问按照这个小孩的方法,能有多 ...

  3. 数学史思维导图_8张思维导图揭示:数学应该如何学,才能逆袭为学霸?

    如果说"如何学习数学?"是一个求解题的话,那么接下来就是该问题的求解过程: 第一步,每个学习者的自身情况不同,学习是受多因素影响的,理应找到到自己的长短板,更能"因材施教 ...

  4. 计算机思维基础概念进行,计算机思维

    1. 美国卡内基·梅隆大学计算机科学系主任周以真(Jeannette M Wing)教授在美 国计算机权威期刊<Communications of the ACM>杂志49卷第3期上发表了 ...

  5. 关于主机的思维导图_计算机网络思维导图(零基础--思维导图详细版本及知识点)...

    计算机网络思维导图(零基础--思维导图详细版本及知识点)_gl620321的博客-CSDN博客​blog.csdn.net第一章 计算机网络概述 1.计算机网络向用户提供的最重要的功能分别是(连通性) ...

  6. 宏观经济学第四章思维导图_宏观经济学思维导图_宏观分析师的自我修养手册:资深从业者万字方法论总结...

    宏观分析师的自我修养手册:资深从业者万字方法论总结 在我印象中,宏观经济学家大概分为两种,一种是三好学生经济学家,典型的英美牛... 你应该可以画出下面这张思维导图,并且如果在其中一个变量里给一个冲击 ...

  7. 腾讯的产品思维 VS 阿里的终局思维

    https://www.cnblogs.com/DicksonJYL/p/9626261.html 腾讯的产品思维 VS 阿里的终局思维 从成立到借壳上市,有赞用了5年多时间.这期间,它有好几次机会死 ...

  8. 用计算机软件绘制思维导图和手绘思维导图,手绘思维导图与计算机思维导图的对比...

    计算机思维导图有许多功能上的优势,而且能够快速复制有机思维的流动性,但是手绘思维导图所具有的优势是一些计算机思维导图所没有具备的. 如果没有计算机可供使用,如果时间有限,如果会议的思想的顺序不明显,那 ...

  9. 计算机发展前景思维导图,计算机绘制思维导图有什么优势

    思维导图又叫心智图,是表达发射性思维的有效的图形思维工具 ,它简单却又极其有效,是一种革命性的思维工具.思维导图运用图文并重的技巧,把各级主题的关系用相互隶属与相关的层级图表现出来,把主题关键词与图像 ...

最新文章

  1. 类、抽象类、接口之间的区别
  2. WPF xaml中列表依赖属性的定义
  3. java学习(85):Interage包装类基本使用
  4. [LeetCode] First Missing Positive
  5. python中文视频教程-中谷教育python中文视频教程(python视频教程) 完整版
  6. cvSetMouseCallback()鼠标坐标、事件返回
  7. 易语言之今日头条新闻收集源码
  8. IDEA 自定义主题
  9. 【备忘】传智播客黑马程序员28期JavaEE基础及就业班视频教程
  10. Linux沙箱技术简介
  11. java支付宝原理_java支付宝支付原理及其问题点
  12. 剪刀石头布java流程图_青岛能源所基于“剪刀石头布”策略实现快速多轮基因编辑...
  13. 如何在功能、特点、价格和性能方面选择PDF编辑器?
  14. 生成自签名证书:生成证书和秘钥
  15. 模仿努比亚网站三(内容区域)
  16. mysql的double类型数据_mysql数据类型double和decimal区别详解
  17. CAD调整十字光标的长度
  18. go开源网络库nano(6)-hander逻辑
  19. html页面内容分页【转】
  20. 嵌套交叉验证的一致特征(Consensus features nested cross-validation)

热门文章

  1. 数据结构题及c语言版实验报告排序,数据结构二叉排序树实验报告
  2. Github博客地址
  3. 读《代码整洁之道》前四章浅显印象 和 我所见的不整洁代码引以为戒
  4. eclipse插件安装方法
  5. php实现网站插件机制的方法
  6. 云计算与SaaS的关系 :新计算时代将来临
  7. zigbee协议_智能家居的ZigBee到底是什么?和Wi-Fi有何区别?
  8. Javascript 解析,格式化日期
  9. 适合做手机铃声的81首歌_“想下载这首歌作为你的手机铃声吗?”
  10. python内置作用域_python中的作用域