当前位置:网站首页>Codeforces Round #802 (Div. 2) 纯补题
Codeforces Round #802 (Div. 2) 纯补题
2022-07-02 18:27:00 【乔大先生】
Educational Codeforces Round 130 Rated for Div. 2
Codeforces Round #802 Div. 2
这次没打比赛,纯补题
A Optimal Path
简单题,甚至可以用循环,但我怕爆时间,简单推个公式
#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;
}
边栏推荐
- 开发固定资产管理系统,开发固定资产管理系统用什么语音
- 全志A33使用主线U-Boot
- 电脑使用哪个录制视频软件比较好
- A4988驱动步进电机「建议收藏」
- Yolov3 trains its own data set to generate train txt
- Hospital online inquiry source code hospital video inquiry source code hospital applet source code
- [0701] [paper reading] allowing data imbalance issue with perforated input during influence
- GMapping代码解析[通俗易懂]
- How to print mybats log plug-in using XML file
- 虚拟机初始化脚本, 虚拟机相互免秘钥
猜你喜欢
Why should we build an enterprise fixed asset management system and how can enterprises strengthen fixed asset management
Markdown基础语法
论文导读 | 关于将预训练语言模型作为知识库的分析与批评
Obligatoire pour les débutants, cliquez sur deux boutons pour passer à un contenu différent
程序猿入门攻略(十二)——数据的存储
Tutoriel (5.0) 10. Dépannage * fortiedr * fortinet Network Security expert NSE 5
[test development] software testing - concept
Advanced performance test series "24. Execute SQL script through JDBC"
End to end object detection with transformers (Detr) paper reading and understanding
《架构整洁之道》读书笔记(下)
随机推荐
云呐|为什么要用固定资产管理系统,怎么启用固定资产管理系统
xml开发方式下AutowiredAnnotationBeanPostProcessor的注册时机
Fastdfs installation
Talk about the design of red envelope activities in e-commerce system
Codeworks 5 questions per day (1700 average) - day 4
QT中的QPropertyAnimation使用和toast案列
MySQL advanced (Advanced) SQL statement
ORA-01455: converting column overflows integer datatype
安装单机redis详细教程
How to print mybats log plug-in using XML file
Tutoriel (5.0) 10. Dépannage * fortiedr * fortinet Network Security expert NSE 5
2022.7.1-----leetcode.241
PHP-Parser羽毛球预约小程序开发require线上系统
论文导读 | 关于将预训练语言模型作为知识库的分析与批评
Binary operation
Gamefi链游系统开发(NFT链游开发功能)丨NFT链游系统开发(Gamefi链游开发源码)
高级性能测试系列《24. 通过jdbc执行sql脚本》
数据降维——因子分析
线程应用实例
Reduce -- traverse element calculation. The specific calculation formula needs to be passed in and combined with BigDecimal