当前位置:网站首页>Codeforces Round #736 (Div. 2) (A-D)
Codeforces Round #736 (Div. 2) (A-D)
2022-07-18 01:52:00 【51CTO】
A. Gregor and Cryptography
The question :
Let you choose two numbers to make n Modulus is equal to these two numbers , Guarantee n Is prime and greater than 5
analysis :
We know n Is prime and greater than 5, Then he must be an odd number , So we export it directly 2 and n-1 that will do .
B. Gregor and the Pawn Game
The question :
Give you a,b Two arrays , Then let you control b Array of 1 Location , He can move to a There are two ways :
- When b Array i Location is 1, If a Array i Location is 0 It must be above ,
- When b Array i Location is 1, If a Array (i-1) Location is 1 Can move to (i-1) Similarly, you can move (i+1)
One place can store at most one , Ask at most ?
analysis :
It can be simulated directly , Just put it , You can't just jump over , Judge from three situations , Select from i Is the position 0 Judge , Pay attention to the marking 1 The location of .
C. Web of Lies
The question :
n Number ,m side , Three operations :
- Add edge u and v Make sure there is no such side before
- Delete edge u and v Make sure there is this side before
- Inquire about , Finally, there are a few points left , The principle is to make contributions if there is no connection at this point , Remove the smallest point value by connecting the edges , Finally, they are all isolated .
analysis :
Let's calculate the point with small value on the edge , Because the deletion point is from small to large , If , This dot is connected with a dot larger than him , Then it must be deleted , So we only need to maintain the number that is not connected by him , Each update only needs to maintain whether there is a larger number difference than him .
D. Integers Have Friends
The question :
After a continuous number takes a modulus of a number, the value is equal , For maximum length .
analysis :
We are equal after taking a pair of modules , hear , Their difference must be gcd>1 Because only in this way can we take modulus equality , So the problem turns into maintenance interval gcd, Find the longest interval gcd>1 The length of . RMQ Can maintain , If you are interested, you can learn .
边栏推荐
- Input only allows you to input English, Chinese and other symbols
- Send your code into space and develop "the greatest work" with Huawei cloud
- [C exercise] print 'x' graphics
- What are the problems we need to pay attention to in setting the standard of Baidu search basic information?
- 2022-07-14 第五小组 修身课 学习笔记(every day)
- How to do Zhihu SEO and how to improve Zhihu SEO ranking?
- IDEA 设置 / 修改快捷键
- Redis profile
- Analyze the meaning of "collaboration" in collaborative office, and how can digital office easily "solve the problem"?
- Issue 44: effective team development
猜你喜欢
随机推荐
【C】函数栈帧的创建和销毁
Issue 53: thoroughly understand MVC, MVP and MVVM
Software testing - Fundamentals
[C exercise] find the K power of n (recursive implementation)
Chapter 14 multi process
STM32 application development practice tutorial: application development of persistent storage of environmental parameters
Issue 45: systematic learning ability
What is CDN acceleration
Officially released vs Code 1.69
WinForm控件属性大全
判断当前请求的网络是内网还是外网
Analyze the meaning of "collaboration" in collaborative office, and how can digital office easily "solve the problem"?
Description and simple implementation of intelligent pointer
redis持久化——rdb
Redis transaction and Message Subscription Publishing
apt-get 无法使用 语法报错
C. K-beautiful Strings
Issue 35: preparation before flutter development
第三十七期:mapState浅析
【C 练习】输入年月,求出月份天数









