补全9月11日至13日课评:为13名学生创建请假文档,为5个班级创建总结文档

This commit is contained in:
chengzi
2026-09-13 19:34:34 +08:00
parent 167d832353
commit 21001eccf5
1322 changed files with 37510 additions and 4136 deletions

View File

@@ -0,0 +1,24 @@
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int n, k, cnt = 0;
long long dp[70010];
int main(){
cin >> n >> k;
for(int i = 1; i <= n; i++){
dp[i] = dp[i-1] + i;
}
for(int i = k; i <= n; i++){
long long curr = dp[i] - dp[i-k];
// 判断这个数是不是某一个数的平方
if((int)sqrt(curr) * (int)sqrt(curr) == curr){
cnt++;
}
}
cout << cnt;
return 0;
}