当前位置:网站首页>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 .
边栏推荐
- TorchDrug教程
- 请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
- 数组中的第K个最大元素
- Wireshark网络抓包
- 大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
- Cache é JSON uses JSON adapters
- 一种将Tree-LSTM的强化学习用于连接顺序选择的方法
- The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
- Esp32-c3 introductory tutorial questions ⑫ - undefined reference to ROM_ temp_ to_ power, in function phy_ get_ romfunc_ addr
- Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines
猜你喜欢

Build your own website (15)

Mxnet implementation of googlenet (parallel connection network)

Don't just learn Oracle and MySQL!

The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology

1、 Introduction to C language

2022 ByteDance daily practice experience (Tiktok)
![[go ~ 0 to 1] read, write and create files on the sixth day](/img/cb/b6785ad7d7c7df786f718892a0c058.png)
[go ~ 0 to 1] read, write and create files on the sixth day

Rookie post station management system based on C language

One question per day (2022-07-02) - Minimum refueling times

Deleting nodes in binary search tree
随机推荐
Rookie post station management system based on C language
模板_判断素数_开方 / 六素数法
How to download files using WGet and curl
千万不要只学 Oracle、MySQL!
MXNet对GoogLeNet的实现(并行连结网络)
Lex and yacc based lexical analyzer + parser
2022年字节跳动日常实习面经(抖音)
NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读
基于unity的愤怒的小鸟设计
[opencv introduction to mastery 9] opencv video capture, image and video conversion
Scala basic tutorial -- 15 -- recursion
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
C语言打印练习
6.26cf simulation match B: solution to array reduction problem
[mathematical basis of machine learning] (I) linear algebra (Part 1 +)
Scala基础教程--20--Akka
Perfect JS event delegation
一种将Tree-LSTM的强化学习用于连接顺序选择的方法
输入的查询SQL语句,是如何执行的?
LeetCode第300场周赛(20220703)