| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 434084 | 刘铄 | 26年3月-B组(才俊)A. 预算统计 | C++ | 通过 | 100 | 44 MS | 384 KB | 318 | 2026-03-25 22:02:14 |
#include <iostream> #include <vector> using namespace std; int main() { int n,k; cin>>n>>k; vector<int> a(n); for(int&x:a)cin>>x; long long res=0,s=0; int l=0; for(int r=0;r<n;r++){ s+=a[r]; while(s>=k)res+=n-r,s-=a[l++]; } cout<<res; return 0; }