当前位置:网站首页>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;
}
边栏推荐
- MySQL
- PHP非对称加密方法私钥及公钥加密解密的方法
- mysql备份后缀是什么_mysql备份还原
- C文件输入操作
- Registration opportunity of autowiredannotationbeanpostprocessor under annotation development mode
- Binary operation
- 冒泡排序数组
- 使用xml文件打印mybaties-log插件的方式
- [error record] problems related to the installation of the shuttle environment (follow-up error handling after executing the shuttle doctor command)
- [paper reading] Ca net: leveraging contextual features for lung cancer prediction
猜你喜欢
Quanzhi A33 uses mainline u-boot
Bubble sort array
Introduction to the paper | analysis and criticism of using the pre training language model as a knowledge base
Develop fixed asset management system, what voice is used to develop fixed asset management system
Transformation of thinking consciousness is the key to the success or failure of digital transformation of construction enterprises
全志A33使用主线U-Boot
Machine learning notes - time series prediction research: monthly sales of French champagne
云呐|为什么要用固定资产管理系统,怎么启用固定资产管理系统
What is 9D movie like? (+ common sense of dimension space)
教程篇(5.0) 09. RESTful API * FortiEDR * Fortinet 网络安全专家 NSE 5
随机推荐
PHP-Parser羽毛球预约小程序开发require线上系统
Idea editor removes SQL statement background color SQL statement warning no data sources are configured to run this SQL And SQL dialect is not config
移动机器人路径规划:人工势场法[通俗易懂]
golang:[]byte转string
2022 compilation principle final examination recall Edition
2022.7.1-----leetcode. two hundred and forty-one
Virtual machine initialization script, virtual machine mutual secret key free
Emmet basic syntax
IDEA编辑器去掉sql语句背景颜色SQL语句警告No data sources are configured to run this SQL...和SQL Dialect is Not Config
453-atoi函数的实现
codeforces每日5题(均1700)-第四天
Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3
《架构整洁之道》读书笔记(下)
AcWing 342. 道路与航线 题解 (最短路、拓扑排序)
metric_logger小解
函数高阶-柯里化实现
Preprocessing and preprocessing macros
Transformation of thinking consciousness is the key to the success or failure of digital transformation of construction enterprises
数据降维——主成分分析
潇洒郎:彻底解决Markdown图片问题——无需上传图片——无需网络——转发给他人图片无缺失