题解:P15430 [蓝桥杯 2025 国 Python B] 等差数列计数
Eternity_A · · 题解
题意分析:
在1~2025里找3个数
具体思路:
我们枚举
代码如下:
#include<bits/stdc++.h>
using namespace std;
const int n = 2025;
int ans;
int main ()
{
for (int i = 1; i <= n; i ++) {
ans += min (i - 1, n - i);
}
cout<<ans * 2;
return 0;
}