题目链接:uva 1397 - The Teacher's Side of Math
题目大意:给出一个方程的解x=a1/m+b1/n,求原方程(给出系数即可)
解题思路:因为方程肯定等于0,所以对于各个系数ax/mby/n都会等于0,于是可以根据这个列出方程,注意最高项的系数始终为1.
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxc = 20;
const int maxn = 40;
typedef long long ll;
typedef double Mat[maxn][maxn];
ll A, M, B, N, C[maxc+5][maxc+5];
Mat G;
voi......
阅读全文