当前位置:网站首页>The long path of Xiao Sha (graph theory, Euler diagram)
The long path of Xiao Sha (graph theory, Euler diagram)
2022-06-26 07:23:00 【Sss_ xxh、】
https://ac.nowcoder.com/acm/contest/23477/E
I drew the shortest path according to the drawing , Is to draw every three adjacent edges into the shortest , It can be found that the shortest path is always n − 1 n - 1 n−1, Then according to the definition , Eulatus is either all even points , Or there are two singularities , You can find , When n In an odd number of , Every point of the complete graph is an even point , So you can go all the way ; When it's even , Every point is a singularity , At least a few edges need to be deleted so that the graph has only two singularities , That's subtracting n / 2 − 1 n/2-1 n/2−1. Then the total number of sides of a complete graph is n ∗ ( n − 1 ) / 2 n * (n - 1) / 2 n∗(n−1)/2, From the formula of the first term plus the last term .
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
int n;
cin >> n;
cout << n - 1 << " ";
if (n % 2 == 0) cout << (1 + n - 1) * (n - 1) / 2 - (n / 2 - 1);
else cout << (1 + n - 1) * (n - 1) / 2;
return 0;
}
边栏推荐
- One chip realizes functions such as spray 𞓜 ws2812 drive | key touch | LED display | voice broadcast chip and simplifies the design of humidifier products
- The first screen time, you said you optimized it, then you calculated it and showed it to me!
- Solution to the problem of multi application routing using thinkphp6.0
- Liquid crystal texture diagram of purple solid mm-tpp-10c methacrylic acid decanoxy tetraphenyl porphyrin and mm-tpp-12c methacrylic acid dodecanoxy tetraphenyl porphyrin - Qi Yue display
- QPS
- Tetra - (4-pyridyl) porphyrin tpyp and metal complexes zntpyp/fetpyp/mntpyp/cutpyp/nitpyp/cotpyp/ptpyp/pdtpyp/cdtpyp (supplied by Qiyue porphyrin)
- Tetradecanoxy tetraphenylporphyrin methacrylate mm-tpp-14c; Cetanoxy tetraphenyl porphyrin methacrylate mm-tpp-16c; Purple solid; Qiyue supply
- A bold sounding and awesome operation - remake a Netflix
- Numpy learning challenge level 4 - numpy array attribute
- Flutter (III) - master the usage of dart language in an article
猜你喜欢

Massive log collection tool flume

3D porphyrin MOF (mof-p5) / 3D porphyrin MOF (mof-p4) / 2D cobalt porphyrin MOF (ppf-1-co) / 2D porphyrin COF (POR COF) / supplied by Qiyue

PXRD, IR, TGA of two-dimensional porphyrin COF (POR COF) /cof (2D pdpor COF) - supplied by Qiyue

. Net 20th anniversary! Microsoft sends a document to celebrate

Machine learning - Iris Flower classification

少年,你可知 Kotlin 协程最初的样子?

5,10,15,20-tetraphenylporphyrin (TPP) and metal complexes fetpp/mntpp/cutpp/zntpp/nitpp/cotpp/pttpp/pdtpp/cdtpp supplied by Qiyue

Liquid crystal texture diagram of purple solid mm-tpp-10c methacrylic acid decanoxy tetraphenyl porphyrin and mm-tpp-12c methacrylic acid dodecanoxy tetraphenyl porphyrin - Qi Yue display

Tetra - (4-pyridyl) porphyrin tpyp and metal complexes zntpyp/fetpyp/mntpyp/cutpyp/nitpyp/cotpyp/ptpyp/pdtpyp/cdtpyp (supplied by Qiyue porphyrin)
![Jemter stress test - visualization tool support - [installation]](/img/e9/9acda4e37c98cc21df9499684205c6.png)
Jemter stress test - visualization tool support - [installation]
随机推荐
Cache usage
报错问题Parameter index out of range(0 < 1) (1 > number of parameters,which is 0
[image enhancement] image defogging based on artificial multiple exposure fusion amef with matlab code
Stm32f1 and stm32subeide programming example - thermal sensor driver
Young man, do you know the original appearance of kotlin association process?
一项听起来大胆,并且非常牛逼的操作——复刻一个 Netflix
Shell input validation alphanumeric only
JMeter stress test web agent local interface test [teaching]
The "big grievances" in the workplace are not only physically tired, but also mentally emptied
$a && $b = $c what???
How to publish function computing (FC) through cloud effect
基于sanic的服务使用celery完成动态修改定时任务
Tetra - (4-pyridyl) porphyrin tpyp and metal complexes zntpyp/fetpyp/mntpyp/cutpyp/nitpyp/cotpyp/ptpyp/pdtpyp/cdtpyp (supplied by Qiyue porphyrin)
异地北京办理居住证详细材料
Summary of domestic database examination data (continuously updated)
一文深入底层分析Redis对象结构
js模块化
Recognize pnpm: faster, higher performance NPM
Jemter stress test - visualization tool support - [installation]
ES cluster_block_exception read_only_allow_delete问题