当前位置:网站首页>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 .
边栏推荐
猜你喜欢
千万不要只学 Oracle、MySQL!
What if the self incrementing ID of online MySQL is exhausted?
Basic tutorial of scala -- 16 -- generics
One question per day (2022-07-02) - Minimum refueling times
[go ~ 0 to 1] read, write and create files on the sixth day
My colleagues quietly told me that flying Book notification can still play like this
Scala basic tutorial -- 18 -- set (2)
性能优化之关键渲染路径
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
What types of Thawte wildcard SSL certificates provide
随机推荐
Principle and application of ThreadLocal
Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
IBM WebSphere MQ检索邮件
Scala basic tutorial -- 17 -- Collection
6.26CF模拟赛E:价格最大化题解
Scala基础教程--18--集合(二)
A method of using tree LSTM reinforcement learning for connection sequence selection
Halcon template matching
Perfect JS event delegation
Cache é JSON uses JSON adapters
Wireshark packet capturing TLS protocol bar displays version inconsistency
Torchdrug tutorial
How to modify icons in VBS or VBE
repeat_P1002 [NOIP2002 普及组] 过河卒_dp
redis分布式锁的8大坑总结梳理
Caché JSON 使用JSON适配器
C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
LeetCode 赎金信 C#解答
IBM WebSphere MQ retrieving messages
DeFi生态NFT流动性挖矿系统开发搭建