当前位置:网站首页>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;
}
边栏推荐
- Implementation of fragment lazy loading after multi-layer nesting
- Processing of inconsistent week values obtained by PHP and MySQL
- 字节缓冲流&字符流详解
- opencv 类的使用
- mysql5.7.25主从复制(单向)
- 语音聊天app源码——钠斯直播系统源码
- Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
- Fiddler下载安装
- 性格测试系统v1.0
- a-table中的rowSelection清空问题
猜你喜欢

【线上问题】Timeout waiting for connection from pool 问题排查

语音聊天app源码——钠斯直播系统源码

What are CSDN spaces represented by

Under a directory of ext3 file system, subfolders cannot be created, but files can be created

Vertical search

神经网络与深度学习-6- 支持向量机1 -PyTorch

keepalived 实现mysql自动故障切换

【Mysql】认识Mysql重要架构(一)

docker配置mysql集群

Original root and NTT 5000 word explanation
随机推荐
wap端微信h5支付,用于非微信浏览器
Solve "note: one or more layouts are missing the layout_width or layout_height attributes."
el-table实现增加/删除行,某参数跟着变
服务器内存故障预测居然可以这样做!
nodejs中mysql的使用
asp.net 使用redis缓存
C# 托管与非托管
Zxing simplified version, reprinted
Exception handling mechanism II
【Flutter -- 布局】Align、Center、Padding 使用详解
volatile 靠的是MESI协议解决可见性问题?(上)
Object type collections are de duplicated according to the value of an attribute
Fiddler抓包工具之移动端抓包
Redis principle and use - Basic Features
如何添加一个PDB
756. Serpentine matrix
使用openLayer画箭头
WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
Li Mu D2L (IV) -- softmax regression
v-premission添加权限