摘要:
题目传送门 一、穷举p和q #include <bits/stdc++.h> using namespace std; //最大公约数 int gcd(int x, int y) { return y ? gcd(y, x % y) : x; } //最小公倍数 int lcm(int x, int 阅读全文
摘要:
#include <bits/stdc++.h> using namespace std; //找出n的所有约数 const int N = 1010; int a[N]; //哪些约数 int idx; //共多少个 void find_divisors(int n) { for (int i = 阅读全文
摘要:
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2010; //n的数值上限 int t; //t次查询 int n; //n个数字中 int m; //找m个数字组合 int C[N 阅读全文