版本比较
ABC292C题解
正文
增加 2 行删除 2 行
4 行未改动5678991011121310 行未改动2425262728282930313219 行未改动4 行未改动对于一个 $4$ 个数的序列 $(A,B,C,D)$,问存在多少个 $A\times B+C\times D=N$。
# 思路
**$O(N^4)$ 算法** **$O(N^4)$ 算法**
暴力枚举所有的 $A,B,C,D$,显然太慢了。
**$O(N^3)$ 算法**10 行未改动
```cpp#include <bits/stdc++.h>using namespace std;
int main() { long long N,ans = 0; cin>>N; for(int i = 1;i < N;i++){19 行未改动