当前位置:网站首页>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;
}
边栏推荐
- NPOI导出Excel2007
- ORA-01455: converting column overflows integer datatype
- 程序猿入门攻略(十二)——数据的存储
- Fastdfs installation
- Juypter notebook modify the default open folder and default browser
- A4988 drive stepper motor "recommended collection"
- SIFT feature point extraction "suggestions collection"
- 股票证券公司排名,有安全保障吗
- 虚拟机初始化脚本, 虚拟机相互免秘钥
- 搭建哨兵模式reids、redis从节点脱离哨兵集群
猜你喜欢

Quanzhi A33 uses mainline u-boot

End to end object detection with transformers (Detr) paper reading and understanding

Data dimensionality reduction principal component analysis

450-深信服面经1

守望先锋世界观架构 ——(一款好的游戏是怎么来的)

Use cheat engine to modify money, life and stars in Kingdom rush

机器学习笔记 - 时间序列预测研究:法国香槟的月销量

《重构:改善既有代码的设计》读书笔记(下)
![[论文阅读] CA-Net: Leveraging Contextual Features for Lung Cancer Prediction](/img/ef/bb48ee88d5dc6fe876a498ab53106e.png)
[论文阅读] CA-Net: Leveraging Contextual Features for Lung Cancer Prediction
![[test development] software testing - concept](/img/24/9ee885d46f7200ae7449957ca96b9d.png)
[test development] software testing - concept
随机推荐
横向越权与纵向越权[通俗易懂]
Introduction to the paper | application of machine learning in database cardinality estimation
Markdown基础语法
思维意识转变是施工企业数字化转型成败的关键
Tutoriel (5.0) 10. Dépannage * fortiedr * fortinet Network Security expert NSE 5
Horizontal ultra vires and vertical ultra vires [easy to understand]
Qpropertyanimation use and toast case list in QT
metric_logger小解
Transformation of thinking consciousness is the key to the success or failure of digital transformation of construction enterprises
Binary operation
Fastdfs installation
论文导读 | 机器学习在数据库基数估计中的应用
新手必看,點擊兩個按鈕切換至不同的內容
教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 網絡安全專家 NSE 5
为什么要做企业固定资产管理系统,企业如何加强固定资产管理
mybatiesHelperPro工具必须的可以生成到对应项目文件夹下
2022.7.1-----leetcode. two hundred and forty-one
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径