Codeforces Round 926 (Div. 2)
A - Sasha and the Beautiful Array
直接找最大和最小的数取差值即可。
123456789101112int n; void solve(void){ cin>>n; int minn=INT_MAX,maxx=0; for (int i=1,x;i<=n;i++){ cin>>x; minn=min(minn,x); maxx=max(maxx,x); } cout<<maxx-minn<<endl;}
B - Sasha and the Drawing
分类讨论一下,很显然,我们直接第一行逐个取格子,第一行是每个格子都可以提供222的新对角线贡献的。kkk小等于于2n2n2n的时候,直接输出⌈k/2⌉\lceil k/2\rceil⌈k/2⌉即可。如果k≥2nk\geq 2nk≥2n,也就是说第一行的格子提供的贡献不够...
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick Start
Test
c=a2+b2c = \sqrt{a^2 + b^2}
c=a2+b2
Create a new post
1$ hexo new "My New Post"
More info: Writing
Run server
1$ hexo server
More info: Server
Generate static files
1$ hexo generate
More info: Generating
Deploy to remote sites
1$ hexo deploy
More info: Deployment