数学题. 1. 因为 1/k = 1/x +1/y 所以 1/k > 1/y 那么 y > k 2 . 因为 x >= y 所以 1/k - 1/y <= 1/y 那么 y <= k 那么y的枚举范围为 k < y <= 2*k 题目还要求你先打印出方案总数那么,直接利用一个数组保存符合条件的y即可. AC代码 #include<cstdio> const int maxn=10000+5; int res[maxn]; int main() { in…
题目链接:https://vjudge.net/problem/UVA-10976 It is easy to see that for every fraction in the form 1k(k > 0), we can always find two positive integers x and y, x ≥ y, such that: 1/k=1/x+1/y Now our question is: can you write a program that counts how ma…