本题可以看出最高的高度其实与平常没有什么区别,因为爱丽丝如果走到第i棵树 ,那么她回来再次遇见这棵树的路程是相同的所以要*2,然后我们只考虑了右端点,没有考虑左端点,所以要i-1;最后取max
#include<bits/stdc++.h>
using namespace std;
int main(void){
ios::sync_with_stdio(false),cout.tie(0),cin.tie(0);
int n;cin>>n;
for(int i=1;i<=n;i++)
{
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(void){
ios::sync_with_stdio(false),cout.tie(0),cin.tie(0);
int n;cin>>n;
for(int i=1;i<=n;i++)
{
cout<<max(n-i,i-1)*2<<endl;}
return 0;
}
0 回复
0 转发
0 喜欢
0 阅读



