当前位置:网站首页>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;
}
边栏推荐
猜你喜欢

Refactoring: improving the design of existing code (Part 1)

教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 网络安全专家 NSE 5
![[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

450-深信服面经1

Markdown basic grammar

Educational Codeforces Round 129 (Rated for Div. 2) 补题题解

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

线程应用实例

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

Watchful pioneer world outlook Architecture - (how does a good game come from)
随机推荐
Usage of ieda refactor
"Patient's family, please come here" reading notes
【pytorch学习笔记】Tensor
Date tool class (updated from time to time)
MySQL
Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3
[paper reading] Ca net: leveraging contextual features for lung cancer prediction
High frequency interview questions
AcWing 1127. 香甜的黄油 题解(最短路—spfa)
PHP parser badminton reservation applet development requires online system
教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 网络安全专家 NSE 5
以太网PHY层芯片LAN8720A简介
MySQL高级(进阶)SQL语句
How to print mybats log plug-in using XML file
Talk about the design of red envelope activities in e-commerce system
横向越权与纵向越权[通俗易懂]
IEDA refactor的用法
Compile oglpg-9th-edition source code with clion
Refactoring: improving the design of existing code (Part 1)
为什么要做企业固定资产管理系统,企业如何加强固定资产管理