当前位置:网站首页>2022 information and future preparation topic 4 new online judge 2034: pruning shrubs
2022 information and future preparation topic 4 new online judge 2034: pruning shrubs
2022-04-21 10:31:00 【joe_ Zxq's programming world】
Memory limit :256 MB The time limit :1 S Standard input and output
Topic type : Traditional evaluation methods : Text comparison uploader : External import
Submit :57 adopt :45
Submit Submit the record Statistics Discussion board
Title Description
Alice has to finish a job of pruning shrubs .
Yes N The shrubs are arranged neatly from left to right .
Alice trims a bush at the party every day , Make the height of the Bush 0 centimeter .
Alice's order of pruning shrubs is to start with the shrub on the far left , Trim a shrub to the right every day .
When the rightmost Bush is trimmed , She'll turn around , Start pruning the shrubs to the left the next day .
Until you trim the leftmost shrub and turn the direction again . And then go back and forth .
Shrubs grow every day from morning to evening 1 centimeter , And the rest of the time will not grow tall .
On the first morning , The height of all shrubs is 0 centimeter . Alice wanted to know how high each Bush was at the top .
Input format
A positive integer N , The meaning is as stated in the title .
30% Test data for :1<N≤10;
100% Test data for :1<N≤10000.
Output format
Output N That's ok , One integer per row , The first i The line represents the first... From left to right i How high can a tree grow .
sample input Copy
3
sample output Copy
4
2
4
Category labels
Basic questions Thinking questions
Ideas :
A little , Direct water .
AC Code :
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vll2 vector<ll,vector<ll> >
#define vi2 vector<int,vector<int> >
#define pii pair<int,int>
#define pll pair<ll,ll>
int main(){
int n; cin>>n;
for(int i=1;i<=n;i++) cout<<max(i-1,n-i)*2<<endl;
return 0;
}
//ACplease!!!
/* printf(" \n");
printf(" \n");
printf(" * * * * * * * * * * * * \n");
printf(" * * * * * * * * \n");
printf(" * * * * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * \n");
*/
版权声明
本文为[joe_ Zxq's programming world]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211000367973.html
边栏推荐
- 如何阅读一份源代码?
- Opencv -- template matching
- 2022信息与未来预备刷题1《New Online Judge 1112: 平面分割》
- SAP ABAP FOR ALL ENTRIES 的用法
- 【并发编程044】CAS循环时间太长,会有什么问题?
- 金融零售图谱-交易流水预警图谱
- Canvas study notes
- Local IP addresses are accessed using domain names
- 作业调度、中级调度、进程调度
- JS initial practice -- an example of dealing with the collision between a pinball and a wall
猜你喜欢

Digital economy - new economy index (2017-2022) & two dimensional indicators of digital economy calculation of 31 provinces (2013-2020)

Uniapp wechat applet clicks the button to call wechat payment

Pytoch gradient check torch autograd. gradcheck

jeecgboot:online表单控件下拉框和下拉搜索框的区别

The prospectus of quwan group is "invalid", and its TT voice has been taken off the shelf. How to achieve stable growth?

24 pictures to conquer border image

Usage of SAP ABAP for all entries

Nanny level tutorial on building personal home page (I)

Local IP addresses are accessed using domain names

ant a-table 树表格级联选择
随机推荐
Better than SQL, another domestic database language was born
[software test series IX] description of matters to be provided for pressure test application
L1-048 矩阵A乘以B (15 分)
背包问题小结(0-1,完全,多重背包问题)
符合类型相关知识点
Cilcate环境搭建
What happens when you run the NPM install command?
Wxml template syntax - data binding
uniapp 微信小程序 点击按钮调用微信支付
Talk about your GC tuning ideas?
postman设置环境变量,简单又实用
ant a-table 表格数据同步
Mieux que SQL, un autre langage de base de données domestique est né
[词性] 二十三、情态动词 2 [ have to ] [ ought to ] [ dare ] [ be able to ] [ needn‘t ]
2022信息与未来预备刷题2《New Online Judge 1113: 位数问题》
内存模型和名称空间知识点总结
WXML模板语法-数据绑定
zsh: segmentation fault 解决方法
requires XXX>=YYY, but you‘ll have XXXX=ZZZ which is incompatible
Jeecgboot: the difference between online form control drop-down box and drop-down search box
http://oj.ecustacm.cn/problem.php?id=2034