当前位置:网站首页>Codeworks round 802 (Div. 2) pure supplementary questions
Codeworks round 802 (Div. 2) pure supplementary questions
2022-07-02 19:32:00 【Mr. Qiao Da】
Educational Codeforces Round 130 Rated for Div. 2
Codeforces Round #802 Div. 2
I didn't play this time , Pure complement
A Optimal Path
Simple questions , You can even use a loop , But I'm afraid of exploding time , Simply push a formula
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e4 + 10;
int n, m;
int T;
signed main()
{
cin>>T;
while(T -- ){
cin >> n >> m;
int op = 0;
if(m % 2) op += (m + 1) / 2 + m / 2 * (m + 1);
else op += (m + 1) * m / 2;
op -= m;
for(int i = 1; i <= n; i ++ ){
op += i * m;
}
cout<<op<<endl;
}
return 0;
}
边栏推荐
- 搭建主从模式集群redis
- Virtual machine initialization script, virtual machine mutual secret key free
- Bubble sort array
- Tutoriel (5.0) 10. Dépannage * fortiedr * fortinet Network Security expert NSE 5
- Tutorial (5.0) 09 Restful API * fortiedr * Fortinet network security expert NSE 5
- Windows2008R2 安装 PHP7.4.30 必须 LocalSystem 启动应用程序池 不然500错误 FastCGI 进程意外退出
- Gamefi chain game system development (NFT chain game development function) NFT chain game system development (gamefi chain game development source code)
- 搭建哨兵模式reids、redis从节点脱离哨兵集群
- Usage of ieda refactor
- End to end object detection with transformers (Detr) paper reading and understanding
猜你喜欢

Yolov3 trains its own data set to generate train txt

Yunna | why use the fixed asset management system and how to enable it

Windows2008R2 安装 PHP7.4.30 必须 LocalSystem 启动应用程序池 不然500错误 FastCGI 进程意外退出

Transformation of thinking consciousness is the key to the success or failure of digital transformation of construction enterprises

IEDA refactor的用法

程序猿入门攻略(十二)——数据的存储

ICDE 2023|TKDE Poster Session(CFP)

Data dimensionality reduction principal component analysis

数据降维——因子分析

安装单机redis详细教程
随机推荐
全志A33使用主线U-Boot
预处理和预处理宏
Golang concurrent programming goroutine, channel, sync
AcWing 343. 排序 题解(floyd性质实现传递闭包)
High frequency interview questions
mybatiesHelperPro工具必须的可以生成到对应项目文件夹下
Processing strategy of message queue message loss and repeated message sending
《重构:改善既有代码的设计》读书笔记(下)
When converting from list to map, if a certain attribute may cause key duplication and exceptions, you can set the way to deal with this duplication
Mobile robot path planning: artificial potential field method [easy to understand]
Markdown基础语法
Fastdfs installation
MySQL table historical data cleaning summary
开发固定资产管理系统,开发固定资产管理系统用什么语音
AcWing 1127. 香甜的黄油 题解(最短路—spfa)
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
MySQL advanced (Advanced) SQL statement
Tutorial (5.0) 09 Restful API * fortiedr * Fortinet network security expert NSE 5
IEDA refactor的用法
Introduction to the paper | analysis and criticism of using the pre training language model as a knowledge base