当前位置:网站首页>Pat 1085 perfect sequence (25 points) perfect sequence
Pat 1085 perfect sequence (25 points) perfect sequence
2022-07-06 20:50:00 【Python ml】
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n,maxnum=0;
long long p;
cin>>n>>p;
vector<int>a(n);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
sort(a.begin(),a.end());
for(int i=0;i<n;i++){
// Determine the minimum value m
for(int j=i+maxnum;j<n;j++){
if (a[j] <= a[i] * p) {
maxnum=max(j-i+1,maxnum);
}else break;
}
}
cout<<maxnum;
system("pause");
return 0;
}
边栏推荐
- Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
- Unity making plug-ins
- Value of APS application in food industry
- Statistical inference: maximum likelihood estimation, Bayesian estimation and variance deviation decomposition
- Use of OLED screen
- Review questions of anatomy and physiology · VIII blood system
- use. Net analysis Net talent challenge participation
- 01 basic introduction - concept nouns
- "Penalty kick" games
- Recyclerview GridLayout bisects the middle blank area
猜你喜欢
Reinforcement learning - learning notes 5 | alphago
Database - how to get familiar with hundreds of tables of the project -navicat these unique skills, have you got it? (exclusive experience)
【每周一坑】正整数分解质因数 +【解答】计算100以内质数之和
Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
Statistical inference: maximum likelihood estimation, Bayesian estimation and variance deviation decomposition
Performance test process and plan
APS taps home appliance industry into new growth points
15 millions d'employés sont faciles à gérer et la base de données native du cloud gaussdb rend le Bureau des RH plus efficace
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)
随机推荐
Reinforcement learning - learning notes 5 | alphago
【DSP】【第二篇】了解C6678和创建工程
【每周一坑】正整数分解质因数 +【解答】计算100以内质数之和
How to upgrade high value-added links in the textile and clothing industry? APS to help
性能测试过程和计划
动态切换数据源
什么是RDB和AOF
【每周一坑】信息加密 +【解答】正整数分解质因数
【OpenCV 例程200篇】220.对图像进行马赛克处理
2022 nurse (primary) examination questions and new nurse (primary) examination questions
[200 opencv routines] 220 Mosaic the image
逻辑是个好东西
The mail command is used in combination with the pipeline command statement
【微信小程序】运行机制和更新机制
2022 Guangdong Provincial Safety Officer C certificate third batch (full-time safety production management personnel) simulation examination and Guangdong Provincial Safety Officer C certificate third
Implementation of packaging video into MP4 format and storing it in TF Card
##无yum源安装spug监控
Application layer of tcp/ip protocol cluster
看过很多教程,却依然写不好一个程序,怎么破?
Can novices speculate in stocks for 200 yuan? Is the securities account given by qiniu safe?