当前位置:网站首页>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;
}
边栏推荐
猜你喜欢

Fiddler抓包工具之移动端抓包

微信小程序学习笔记1

JS output diamond on the console

您的登录IP不在管理员配置的登录掩码范围内

OFDM Lecture 16 - OFDM

2022 Shanghai safety officer C certificate examination questions and mock examination
![[MySQL] how to execute an SQL statement (2)](/img/7b/53f8756458cc318e2f417b1cc0c3f8.png)
[MySQL] how to execute an SQL statement (2)

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

el-table实现增加/删除行,某参数跟着变

(2006, MySQL server has gone away) problem handling
随机推荐
Exception handling mechanism II
Zipkin installation and use
调用DLL开启线程的问题
点击input时,不显示边框!
Object 的Wait Notify NotifyAll 源码解析
Li Mu D2L (V) -- multilayer perceptron
docker配置mysql集群
sublime 安装插件
keepalived 实现mysql自动故障切换
2020-12-29
Selection and practice of distributed tracking system
tabbarController的使用
I'm faded
如何添加一个PDB
Elastic APM installation and use
Redis principle and usage - installation and distributed configuration
大二上第三周学习笔记
756. Serpentine matrix
"Could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32"
a-table中的rowSelection清空问题