当前位置:网站首页>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;
}
边栏推荐
- PHP非对称加密方法私钥及公钥加密解密的方法
- 新手必看,点击两个按钮切换至不同的内容
- [pytorch learning notes] tensor
- Quanzhi A33 uses mainline u-boot
- 搭建主从模式集群redis
- Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
- C的内存管理
- Data dimensionality reduction factor analysis
- Golang concurrent programming goroutine, channel, sync
- Qpropertyanimation use and toast case list in QT
猜你喜欢
![[0701] [paper reading] allowing data imbalance issue with perforated input during influence](/img/c7/9b7dc4b4bda4ecfe07aec1367fe059.png)
[0701] [paper reading] allowing data imbalance issue with perforated input during influence

Chic Lang: completely solve the problem of markdown pictures - no need to upload pictures - no need to network - there is no lack of pictures forwarded to others

Compile oglpg-9th-edition source code with clion

Juypter notebook modify the default open folder and default browser

安装单机redis详细教程

新手必看,點擊兩個按鈕切換至不同的內容

xml开发方式下AutowiredAnnotationBeanPostProcessor的注册时机

Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径

Tutorial (5.0) 10 Troubleshooting * fortiedr * Fortinet network security expert NSE 5

教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 網絡安全專家 NSE 5
随机推荐
【测试开发】软件测试—概念篇
Typescript 之 快速入门
仿京东放大镜效果(pink老师版)
Golang concurrent programming goroutine, channel, sync
论文导读 | 关于将预训练语言模型作为知识库的分析与批评
[paper reading] Ca net: leveraging contextual features for lung cancer prediction
Reading notes of "the way to clean structure" (Part 2)
《代码整洁之道》读书笔记
Transformation of thinking consciousness is the key to the success or failure of digital transformation of construction enterprises
Gstore weekly gstore source code analysis (4): black and white list configuration analysis of security mechanism
Why should we build an enterprise fixed asset management system and how can enterprises strengthen fixed asset management
Tutorial (5.0) 10 Troubleshooting * fortiedr * Fortinet network security expert NSE 5
Notes de lecture sur le code propre
MySQL高级(进阶)SQL语句
Quanzhi A33 uses mainline u-boot
线程应用实例
Use cheat engine to modify money, life and stars in Kingdom rush
ORA-01455: converting column overflows integer datatype
End to end object detection with transformers (Detr) paper reading and understanding
Golang concurrent programming goroutine, channel, sync