当前位置:网站首页>Smart gourmet C language
Smart gourmet C language
2022-07-26 09:26:00 【jeff one】
Smart gourmet C Language
Title Description :
If someone thinks that eating only needs a mouth , It would be wrong .
We all know that the tongue has such a characteristic ,“ From simplicity to luxury, it's easy , It's hard to be as simple as extravagance ”( According to the study of good people , This law also applies to many other situations ). To be specific , If it's dessert , When the food you eat is not as sweet as what you have just eaten , It's very unpleasant .
Dabao is a smart gourmet , Of course, I know this well . Once he came to a snack street , Ready to eat from one end of the street to the other . In order to eat well , He took a lot of trouble , Got all kinds of food “ Delicacy ”. He rejected unpleasant experiences , Don't go back and be refreshing ( As many times as possible ).
Input :
Input description :
Two lines of data .
The first line is an integer n, Indicates the number of snacks on the snack street
Second behavior n It's an integer , respectively n Grow food “ Delicacy ”
sample input :
10
3 18 7 14 10 12 23 41 16 24
Output :
Output description :
An integer , Indicates the number of times you eat well
sample output :
6
Tips :
HINT: The time limit :1.0s Memory limit :256.0MB
The delicacy is 0 To 100 The integer of
n<1000
source :
Blue Bridge Cup practice system ID: 320 Original link : http://lx.lanqiao.cn/problem.page?gpid=T320
#include <stdio.h>
int a[1010],b[1010],i,j,k;
int main()
{
int num;
scanf("%d",&num);
for(i=1;i<=num;i++)
scanf("%d",&a[i]);
for(i=1;i<=num;i++)
b[i]=1;
for(i=1;i<=num;i++)
{
for(j=1;j<i;j++)// Count from the first to i
{
if(a[i]>=a[j])
{
b[i]=b[i]>b[j]+1?b[i]:b[j]+1;
}
}
}
k=1;
for(i=num;i>=0;i--)
if(k<b[i])
{
k=b[i];
}
printf("%d",k);
return 0;
}
边栏推荐
猜你喜欢
随机推荐
Innovus is stuck, prompting x error:
Basic use of ArcGIS 1
When you click input, the border is not displayed!
异常处理机制二
语音聊天app源码——钠斯直播系统源码
ZXing简化版,转载
注册模块用例编写
tabbarController的使用
暑假末尾学习笔记
Force button list question
Exception handling mechanism II
【Mysql】一条SQL语句是怎么执行的(二)
Zipkin installation and use
音视频知识
wap端微信h5支付,用于非微信浏览器
Mysql事务
[arkit, realitykit] turn pictures into 3D models
v-premission添加权限
安卓 实现缓存机制,多种数据类型缓存
【线上问题】Timeout waiting for connection from pool 问题排查









