当前位置:网站首页>2021 Hefei informatics competition primary school group
2021 Hefei informatics competition primary school group
2022-07-04 19:20:00 【Small Turing programming】
1、 COVID-19 population immunity (covid)
COVID-19 has been in the world for nearly two years. , It has brought great trouble to all countries in the world , In order to defeat COVID-19 finally , Various countries are stepping up vaccine research and development , At present, our country has developed and issued inactivated vaccine 、 Adenovirus vector vaccine and other new coronavirus vaccines with different technologies , While meeting their own needs , It has also helped many countries , Together to curb the spread of the virus . Prevention is better than cure , Only by reaching a certain proportion of vaccination , That is to achieve mass immunization , That's the way to defeat COVID-19. . Studies have shown that , Different vaccine efficacy , The proportion of people who achieve mass immunization is different , Suppose that the vaccinated population of a country only reaches half of the total population of the country 75%, Group immunity can be achieved . Please calculate how many people need to be vaccinated in a country to achieve mass immunization .
Input :
The input data consists of 1 That's ok 1 A positive integer , Indicates the total population of a country , Unit: 10000 persons .
Output :
common 1 Line a positive integer , Indicates the number of people who need to be vaccinated to achieve mass immunization , rounding , Unit: 10000 persons .
Examples 1:
Input :(covid.in)
100
Output :(covid.out)
75
Data range :100≤ The total population ≤100000
2、 Organize books (book)
Another semester is over , I have accumulated many more books , You decided to tidy up , There are three operations in sorting , The following rules :
1 p It means to number p Put your book at the front
2 p It means to number p Put your books at the back
3 p q It means to number p Put your book under the number q Behind my book
1、2、3 Each represents the type of sorting operation ,p、q Indicates the number of the book , They are separated by spaces ; It is known that before sorting , All books from 1 Start numbering and discharging in sequence .
Input :
common m+1 That's ok . The first line has two positive integers separated by spaces n and m, respectively n This book
and m Finishing operation , Next m That's ok , Each row has 2 Or 3 A positive integer separated by a space ,
Corresponding to the above three sorting operations .
Output :
common 1 That's ok , The order of the sorted books , The books are separated by spaces .
Examples :
Input :(book.in)
10 4
1 3
2 4
3 3 6
3 1 5
Output :(book.out)
2 5 1 6 3 7 8 9 10 4
Data range :1≤n,m≤100000
3、 CY Craft (cycraft)
As the game goes on , You also get a lot of weapons and equipment , Every acquisition of a weapon and equipment requires a certain price . Suppose you have a timeline , It records that there is a weapon corresponding to a certain point in time , We give every point in time ti Weapons and equipment corresponding to the time i The power value of is wi. At this time, you have a time shuttle , You can shuttle through the time axis at will , Suppose you go back and forth to a point in time t, Definition t Time point to ti Point in time acquisition i The cost of weaponry is |t-ti|*wi. Please calculate which t The total cost of acquiring all weapons and equipment at a time point is the smallest , Output minimum total cost . Every weapon and equipment must be acquired from t Time to start , return t The cost of a point in time is 0;|t-ti| Express t-ti The absolute value of .
Input :
common n+1 That's ok , First line a positive integer n, Indicates the total number of weapons and equipment , Next n That's ok , Each row
Two positive integers separated by spaces , They represent time ti Corresponding weapons and equipment at that time
Power value wi.
Output :
common 1 Line an integer , Represents the minimum cost of acquiring all weapons .
Examples 1:
Input :(cycraft.in)
4
-1 7
0 2
7 3
3 4
Output :(cycraft.out)
40
Sample explanation : Shuttle to 0 The total cost of acquiring all weapons and equipment at any time :1*7+7*3+3*4=40. Wear
Shuttle to 7 The total cost of acquiring all weapons and equipment at any time :8*7+7*2+4*4=86 ...
Data range :1≤n≤10000,-1000≤ti,wi≤1000.
4、 Mice love food (mouse)
There are many people on one road 1 Start numbering the mouse's favorite food , Suppose there are an infinite number of delicious foods , And the mice flashed randomly next to any food , Then try some delicious food in turn , At least try the next food when it first appears , Ask which two adjacent delicacies are tried the most by rats , Output as many times as possible . Make sure each mouse appears and stops with a different food number .
Input :
The input data are n+1 That's ok , The first line shows the number of mice n, Next n Each row has two numbers ,
Respectively represent the food number of the mouse for the first time , And stop the food number
Output :
One positive integer per line , Indicates the maximum number of times .
Examples 1:
Input :(mouse.in)
3
1 4
2 5
3 7
Output :(mouse.out)
3
Sample explanation :
share 3 A mouse , The first one tried in turn 1-2-3-4 common 4 Grow food ; The second one tried in turn
2-3-4-5 Here you are 4 Chinese cuisine ; The third one tried in turn 3-4-5-6-7 common 5 Grow food . The adjacent 3-4
Food has been tried 3 Time .
Data range :2≤n≤10000, The variety of food is guaranteed to be in int Within the scope of , Each mouse appears and stops
The food numbers are different .
边栏推荐
- ThreadLocal原理与使用
- 其他InterSystems %Net工具
- 输入的查询SQL语句,是如何执行的?
- Caché JSON 使用JSON适配器
- Summary and sorting of 8 pits of redis distributed lock
- Rookie post station management system based on C language
- BI技巧丨权限轴
- Scala basic tutorial -- 20 -- akka
- Wireshark packet capturing TLS protocol bar displays version inconsistency
- C语言打印练习
猜你喜欢
Microservice architecture debate between radical technologists vs Project conservatives
[go ~ 0 to 1] read, write and create files on the sixth day
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
[2022 Jiangxi graduate mathematical modeling] curling movement idea analysis and code implementation
Lex and yacc based lexical analyzer + parser
vbs或vbe如何修改图标
Li Kou brush question diary /day4/6.26
Angry bird design based on unity
DeFi生态NFT流动性挖矿系统开发搭建
物联网应用技术的就业前景和现状
随机推荐
Halcon template matching
php伪原创api对接方法
IBM WebSphere MQ retrieving messages
[uniapp] uniapp development app online Preview PDF file
1、 Introduction to C language
sqlserver的CDC第一次查询的能读取到数据,但后面增删改读取不到,是什么原因
The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
2021 合肥市信息学竞赛小学组
How to download files using WGet and curl
Wireshark抓包TLS协议栏显示版本不一致问题
26. 删除有序数组中的重复项 C#解答
Is Guoyuan futures a regular platform? Is it safe to open an account in Guoyuan futures?
输入的查询SQL语句,是如何执行的?
基于C语言的菜鸟驿站管理系统
6.26CF模拟赛E:价格最大化题解
Li Chi's work and life summary in June 2022
Li Kou brush question diary /day2/2022.6.24
LeetCode 赎金信 C#解答