当前位置:网站首页>蓝桥杯_挑选子串_组合数学_乘法原理_ / 尺取法
蓝桥杯_挑选子串_组合数学_乘法原理_ / 尺取法
2022-06-10 16:42:00 【这题AC再睡.】

//
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=2e5+6;
LL in[N],f[N];
int main()
{
LL n,m,k,i,pos,ans;
while( cin>>n>>m>>k )
{
ans=pos=0;
for( i=1;i<=n;i++ )
{
cin>>in[i];
if( in[i]<m ) continue;
f[++pos]=i; // ++pos
if( pos<k ) continue;
// 1
if( pos==k ) ans+=f[1]*( n-i+1 );
else ans+=( f[pos-k+1]-f[pos-k] )*( n-i+1 );
} // pos-k>=1 ==> ++pos
cout<<ans<<endl;
}
return 0;
}边栏推荐
- Detailed steps for installing redis image in docker (easy to understand, suitable for novices to get started quickly)
- Numpy learning notes
- KDD 2021 | MoCl: comparative learning of molecular graphs using multi-level domain knowledge
- ADB is not an internal or external command, nor is it a runnable program or batch file
- Gateway服务网关
- Thread interview related questions
- It has become a unicorn since its establishment one year ago. Tencent didi is the "backer". This year's new unicorn is not simple
- 单片机底层通信协议① —— 同步和异步、并行和串行、全双工和半双工以及单工、电平信号和差分信号
- Detailed derivation of perspective projection transformation and related applications
- AIChE | 集成数学规划方法和深度学习模型的从头药物设计框架
猜你喜欢

Only three steps are needed to learn how to use low code thingjs to connect with Sen data Dix data

Graduation season: to you

Brands are difficult to establish, IPO is difficult, and Chinese tea enterprises are trapped in "tradition"?
Redis operation set, Zset, hash data types and use of visualization tools

A few misunderstandings about programmers are very harmful!

Solve the problem that idea is stuck in opening a project

线程面试相关问题

Smart Scenic Spot Video Monitoring 5G Smart lamp Gateway Network Integrated pole

虚拟机ping不通的几种原因及解决办法

仅需三步学会使用低代码ThingJS与森数据DIX数据对接
随机推荐
亟需丰富智能家居产品线,扫地机器人赛道上挤得下萤石吗?
Fabric. JS zoom canvas
Create and install the visual studio offline installation package
Example code of PHP for uploading multiple pictures
PrimeKG : 构建知识图谱以实现精确医疗
Photoshop如何打开、编辑和导出Webp格式图片的方法
厉害了,工信部推出 “一键解绑” 手机号绑定的互联网账号,堪称神器
Intelligent scenic spot video monitoring 5g intelligent light pole gateway networking integrated pole
如何运行plink软件--三种方法
Daily question -1287 Elements that appear more than 25% in an ordered array
Detailed derivation of perspective projection transformation and related applications
基于PHP+Web+Mysql的在线问卷调查系统
【抬杠C#】如何实现接口的base调用
虚拟机ping不通的几种原因及解决办法
Mysql database implementation setting field length
B站不想成为“良心版爱优腾”
Who is using my server? what are you doing? when?
KDD 2021 | MoCl: comparative learning of molecular graphs using multi-level domain knowledge
Flood control and drainage monitoring automatic monitoring and telemetering terminal for flood control and drainage
VBA judge whether the file exists and ask for the idea of file backup