记录编号 588120 评测结果 AAAAAAAAAA
题目名称 零落尘 最终得分 100
用户昵称 Gravatar┭┮﹏┭┮ 是否通过 通过
代码语言 C++ 运行时间 0.419 s
提交时间 2024-05-26 21:50:22 内存使用 17.55 MiB
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define in inline
#define re register
#define pii pair<int,int>
#define se second
#define pb(x) push_back(x)
#define D(i,a,b) for(re int i = a;i >= b;i--)
#define F(i,a,b) for(re int i = a;i <= b;i++)
const int N = 5e6+10,M = 320;
const ll inf = 1e17;

ll read(){
    ll x = 0,f = 1;char c = getchar();
    for(;c < '0' || c > '9';c = getchar())if(c == '-')f = -1;
    for(;c >= '0' && c <= '9';c = getchar())x = (x<<1) + (x<<3) + c-'0';
    return x * f;
}

ll n,m,k,s,ans;
ll a[N];
int main(){
    freopen("sporadic.in","r",stdin);
    freopen("sporadic.out","w",stdout);
    n = read(),m = read(),k = read();
    F(i,1,n)a[i] = read();
    for(int l = 1,r = 0;l <= n;l++){
        while(s < k && r <= n)s += a[++r] >= m;
        if(s >= k)ans += n - r + 1;
        s -= a[l] >= m;
    }
    printf("%lld\n",ans);
    
	return cerr << "Time : " << clock() << " ms" << endl, 0;
        
}