当前位置:网站首页>Blue Bridge Cup_ Pick substring_ Combinatorial mathematics_ Multiplication principle/ Ruler method
Blue Bridge Cup_ Pick substring_ Combinatorial mathematics_ Multiplication principle/ Ruler method
2022-06-10 22:45:00 【This question AC sleep again】

//
#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;
}边栏推荐
- 【TcaplusDB知识库】TcaplusDB shard搬迁介绍
- Visio to high quality pdf
- 【TcaplusDB知识库】TcaplusDB日常巡检介绍
- CCF CSP 202109-4 collect cards
- Reflow and repaint
- 【TcaplusDB知识库】TcaplusDB巡检统计介绍
- How to do well in the top-level design of informatization in the process of informatization upgrading of traditional enterprises
- Matlab - Implementation of evolutionary game theory
- 【phpstorm】 No data sources are configured to run this SQL and provide advanced c
- Tcapulusdb Jun · industry news collection (VI)
猜你喜欢
![[tcapulusdb knowledge base] tcapulusdb viewing process status introduction](/img/8d/fc454b23489edcd8a7528a0acd3a02.png)
[tcapulusdb knowledge base] tcapulusdb viewing process status introduction

MySQL master-slave replication solves read-write separation

How can small and medium-sized conferences be upgraded digitally?

【phpstorm】 No data sources are configured to run this SQL and provide advanced c
![[tcapulusdb knowledge base] tcapulusdb viewing online operation](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[tcapulusdb knowledge base] tcapulusdb viewing online operation

鲸会务会议分享:大会难办怎么办?

《暗黑破坏神不朽》数据库资料站地址 暗黑不朽资料库网址
![[MySQL] Table constraints](/img/13/b97679cd4ca36d4b8e19acf23df404.png)
[MySQL] Table constraints

Tcapulusdb Jun · industry news collection (I)

Whale conference sharing: what should we do if the conference is difficult?
随机推荐
【TcaplusDB知识库】TcaplusDB刷新tbus通道介绍
Use of cocoeval function
Model construction of mmdetection
mathtype7.x的基本使用
What about the popular state management library mobx?
[XPath] use following sibling to obtain the following peer nodes
Visio to high quality pdf
[Axi] explain the principle of two-way handshake mechanism of Axi protocol
【Debug】could not find ref wiht poc XXX解决
[tcapulusdb knowledge base] Introduction to tcapulusdb patrol inspection statistics
[tcapulusdb knowledge base] tcapulusdb tcapdb capacity expansion and contraction introduction
【问题】解决Websocket字符串长度限制问题单包过大
存储引擎分析
【TcaplusDB知识库】TcaplusDB查看线上运行情况介绍
记录(二)
(十一)TableView
C language internal skill cultivation [integer stored in memory]
[tcapulusdb knowledge base] tcapulusdb shard relocation introduction
数字孪生:第三人称鼠标操作
中小型会议如何进行数字化升级?