【CS Round #44 (Div. 2 only) D】Count Squares
【链接】点击打开链接
【题意】
【题解】
【错的次数】
【反思】
【代码】
/* */
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <cstdlib>
#include <cmath>
#include <bitset>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb emplace_back
#define fi first
#define se second
#define ld long double
#define ms(x,y) memset(x,y,sizeof x)
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rs(x) scanf("%s",x)
#define rf(x) scnaf("%lf",&x)
#define oi(x) printf("%d",x)
#define ol(x) printf("%lld",x)
#define oc putchar(' ')
#define os(x) printf(x)
#define all(x) x.begin(),x.end()
#define Open() freopen("F:\\rush.txt","r",stdin)
#define Close() ios::sync_with_stdio(0)
#define sz(x) ((int) x.size())
#define ld long double typedef pair<int, int> pii;
typedef pair<LL, LL> pll; //mt19937 myrand(time(0));
//int get_rand(int n){return myrand()%n + 1;}
const int dx[9] = { 0,1,-1,0,0,-1,-1,1,1 };
const int dy[9] = { 0,0,0,-1,1,-1,1,-1,1 };
const double pi = acos(-1.0);
const int N = 110;
const LL MOD = 1e9 + 7;
LL ans = 0; int n, m; int main() {
//Open();
//Close();
ri(n), ri(m);
rep1(i, 1, min(n, m)) {
ans += (LL)i*(n - i + 1)*(m - i + 1);
ans %= MOD;
}
ol(ans); puts("");
return 0;
}
【CS Round #44 (Div. 2 only) D】Count Squares的更多相关文章
- 【CS Round #44 (Div. 2 only) A】Frequent Numbers
[链接]h在这里写链接 [题意] 在这里写题意 [题解] 大水题 [错的次数] 0 [反思] 在这了写反思 [代码] /* */ #include <cstdio> #include &l ...
- 【CS Round #44 (Div. 2 only) B】Square Cover
[链接]点击打开链接 [题意] 给你一个n*m的矩形,让你在其中圈出若干个子正方形,使得这些子正方形里面的所有数字都是一样的. 且一样的数字,都是在同一个正方形里面.问你有没有方案. [题解] 相同的 ...
- 【CS Round #44 (Div. 2 only) C】Check DFS
[链接]点击打开链接 [题意] 给你一个n节点,m条边的无向联通图. 给你一个节点访问的顺序.(1..n的排列) 你可以改变每个点优先访问的出度.(但必须按照dfs的规则); 问你能不能按照所给的访问 ...
- 【CS Round #36 (Div. 2 only) A】Bicycle Rental
[题目链接]:https://csacademy.com/contest/round-36/task/bicycle-rental/ [题意] 让你从n辆车中选一辆车; 每一辆车有3个属性 1.到达车 ...
- 【CS Round #37 (Div. 2 only) D】Reconstruct Graph
[Link]:https://csacademy.com/contest/round-37/task/reconstruct-graph/statement/ [Description] 给你一张图; ...
- 【CS Round #37 (Div. 2 only) B】Group Split
[Link]:https://csacademy.com/contest/round-37/task/group-split/ [Description] 让你把一个数分成两个数a.b的和; (a,b ...
- 【CS Round #37 (Div. 2 only) A】Boring Number
[Link]:https://csacademy.com/contest/round-37/task/boring-number/ [Description] 让你找离平均数最近的一个数的下标; [S ...
- 【CS Round #39 (Div. 2 only) D】Seven-segment Display
[Link]:https://csacademy.com/contest/round-39/task/seven-segment-display/ [Description] 0..9各自有一个数字, ...
- 【CS Round #39 (Div. 2 only) C】Reconstruct Sum
[Link]:https://csacademy.com/contest/round-39/task/reconstruct-sum/ [Description] 给你一个数字S; 让你找有多少对A, ...
随机推荐
- 浅述html5和web app
题外话:最近跟不少产品解释技术术语,比如脚本.数据库.H5等等,我一般会把他们当成稍微了解这些技术的人,用专业的语言描述一遍,然后用通俗的语言解释一遍,最后举例子解释一遍. 肯定有人问,你把流程反过来 ...
- Tensorflow 学习笔记 -----tf.where
TensorFlow函数:tf.where 在之前版本对应函数tf.select 官方解释: tf.where(input, name=None)` Returns locations of true ...
- ldd---程序所需要的动态链接库
ldd本身不是一个程序,而仅是一个shell脚本:ldd可以列出一个程序所需要得动态链接库(so) [root@xiaolizi ~ ]$ ldd /usr/bin/ls linux-vdso.so. ...
- android对话框显示异常报错:You need to use a Theme.AppCompat theme (or descendant) with this activity.
今天写android实验碰到到一个问题,在用AlertDialog.Builder类构建一个对话框之后,调用Builder.show()方法时抛出异常如下: - ::-/xyz.qlrr.sqlite ...
- qt获取磁盘序列号
#include "windows.h" QString lpRootPathName = "c:\\"; LPTSTR lpVolumeNameBuffer= ...
- cogs 32. [POI1999] 位图
32. [POI1999] 位图 ★ 输入文件:bit.in 输出文件:bit.out 简单对比时间限制:1 s 内存限制:128 MB [问题描述 ] 给定一个 n*m 的矩形位图, ...
- 排序(1)---------选择排序(C语言实现)
选择排序的基本思想: 选择排序(Selection sort)是一种简单直观的排序算法. 它的工作原理例如以下.首先在未排序序列中找到最小(大)元素,存放到排序序列的起始位置,然后,再从剩余未排序元素 ...
- C语言的有符号与无符号,二进制整数的扩展与截断
C语言的有符号与无符号,二进制整数的扩展与截断 前一节说了整数的表示方式,,也就是无符号编码与补码编码.这一届说一下二进制整数的扩展与截断,这部分内容与C语言挂钩.so,我们先看下面C语言的有符号和无 ...
- 【HDU 4763】Theme Section(KMP)
这题数据水的一B.直接暴力都能够过. 比赛的时候暴力过的.回头依照正法做了一发. 匹配的时候 失配函数 事实上就是前缀 后缀的匹配长度,之后就是乱搞了. KMP的题可能不会非常直接的出,可是KMP的思 ...
- javafx image zoom
public class EffectTest extends Application { private final ImageView imageView = new ImageView(); p ...