当前位置:网站首页>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;
}
边栏推荐
- PHP非对称加密方法私钥及公钥加密解密的方法
- 守望先锋世界观架构 ——(一款好的游戏是怎么来的)
- Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3
- Bubble sort array
- C file input operation
- Emmet basic syntax
- Yolov3 trains its own data set to generate train txt
- 《重构:改善既有代码的设计》读书笔记(下)
- Compile oglpg-9th-edition source code with clion
- Excel finds the same value in a column, deletes the row or replaces it with a blank value
猜你喜欢

Introduction to the paper | application of machine learning in database cardinality estimation

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

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

Watchful pioneer world outlook Architecture - (how does a good game come from)

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

Processing strategy of message queue message loss and repeated message sending

AcWing 342. 道路与航线 题解 (最短路、拓扑排序)

Codeworks 5 questions per day (1700 average) - day 4

According to the atlas of data security products and services issued by the China Academy of information technology, meichuang technology has achieved full coverage of four major sectors

教程篇(5.0) 09. RESTful API * FortiEDR * Fortinet 网络安全专家 NSE 5
随机推荐
Golang并发编程——goroutine、channel、sync
数据降维——主成分分析
Use cheat engine to modify money, life and stars in Kingdom rush
【ERP软件】ERP体系二次开发有哪些危险?
思考变量引起的巨大变化
电脑使用哪个录制视频软件比较好
[0701] [paper reading] allowing data imbalance issue with perforated input during influence
Compile oglpg-9th-edition source code with clion
守望先锋世界观架构 ——(一款好的游戏是怎么来的)
Excel finds the same value in a column, deletes the row or replaces it with a blank value
PHP asymmetric encryption method private key and public key encryption and decryption method
Educational Codeforces Round 129 (Rated for Div. 2) 补题题解
codeforces每日5题(均1700)-第四天
Windows2008r2 installing php7.4.30 requires localsystem to start the application pool, otherwise 500 error fastcgi process exits unexpectedly
metric_logger小解
AcWing 383. 观光 题解(最短路)
Binary operation
Reduce -- traverse element calculation. The specific calculation formula needs to be passed in and combined with BigDecimal
Is there any security guarantee for the ranking of stock and securities companies
数据降维——因子分析