当前位置:网站首页>蓝桥杯_挑选子串_组合数学_乘法原理_ / 尺取法
蓝桥杯_挑选子串_组合数学_乘法原理_ / 尺取法
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;
}边栏推荐
- Fail fast and fail safe
- fail-fast和fail-safe
- 使用KuboardSpray安装kubernetes(v1.23.1)
- 开源项目 PM 浅谈如何设计官网
- 几个对程序员的误解,害人不浅!
- 用代码设计药物:我们到了吗?
- Xinsi technology helps Israel visuality systems promote the "left shift" of security
- This article introduces you to j.u.c's futuretask, fork/join framework and BlockingQueue
- Fabric. JSON for JS compact output
- 元宇宙的定义和 7 大无限特征
猜你喜欢
![[BSP video tutorial] BSP video tutorial issue 17: single chip microcomputer bootloader topic, startup, jump configuration and various usage of debugging and downloading (2022-06-10)](/img/75/a3336aa7314a2dfc9a7a32995793e7.png)
[BSP video tutorial] BSP video tutorial issue 17: single chip microcomputer bootloader topic, startup, jump configuration and various usage of debugging and downloading (2022-06-10)

com.netflix.client.ClientException: Load balancer does not have available server for client: userser

带你初步了解 类和对象 的基本机制

Under the "plastic ban order", does the Hong Kong stock exchange pay for the deep excavation of degradable plastics by Zhongbao new materials?

“挽弓当挽强,用箭当用长”,曼孚科技为数据服务行业开启新赛道

重庆第一个科创板IPO,来了

仅需三步学会使用低代码ThingJS与森数据DIX数据对接

丢失的遗传力--Missing heritability

Station B doesn't want to be a "conscience aiyouteng"

如何运行plink软件--三种方法
随机推荐
【玩转华为云】手把手带你使用鲲鹏代码迁移工具实现源码迁移
Web3 is the most complete money making secret script. Just read this one
当v-if和v-for需要同时使用的时候
软件项目管理 6.10.成本预算
Fabric.js 激活输入框
Brands are difficult to establish, IPO is difficult, and Chinese tea enterprises are trapped in "tradition"?
用代码设计药物:我们到了吗?
关于透视投影变换及相关应用的详细推导
AIChE | 集成数学规划方法和深度学习模型的从头药物设计框架
Is the fund of futures account safe?
Online communication skill network: a sparse model for solving multi task and multi-modal problems (Qingyuan talk, issue 19, tangduyu)
Full link tracking & performance monitoring tool skywalking practice
运筹说 第64期丨动态规划奠基人——理查德·贝尔曼
Fabric.js 元素被选中时保持原有层级
Intelligent scenic spot video monitoring 5g intelligent light pole gateway networking integrated pole
丢失的遗传力--Missing heritability
Nat. Commun. | 用于加速发现抗生素抗性基因的知识整合和决策支持
Fail fast and fail safe
web集群基础知识学习(1)
Facebook AI | learning reverse folding from millions of prediction structures