链接:http://pat.zju.edu.cn/contests/pat-a-practise/1009
题意:计算多项式的乘积。
分析:基于编程方便,还是采用数组的方式来实现。
#include<stdio.h> typedef struct Poly { int exp; double coe; } Poly; Poly a[1005]; Poly b[1005]; double res[2005]; int main() { int n; scanf("%d", &n); int i; for (i = 0; i < n; i++) { scanf("%d%lf", &a[i].exp, &a[i].coe); } int m; scanf("%d", &m); for (i = 0; i < m; i++) { scanf("%d%lf", &b[i].exp, &b[i].coe); } int j; for (i = 0; i < n; i++) for (j = 0; j < m; j++) { res[a[i].exp + b[j].exp] += a[i].coe * b[j].coe; } int count = 0; for (i = 0; i < 2005; i++) { if (res[i]) { count++; } } printf("%d", count); for (i = 2005; i >= 0; i--) { if (res[i]) printf(" %d %.1lf", i, res[i]); } printf("\n"); return 0; }
相关推荐
and how Brouncker's formula of 1655 can be derived from Euler's efforts in Special Functions and Orthogonal Polynomials. The most interesting applications of this work are discussed, including the ...
Computing Roots of Polynomials ,采用数值方法求根,速度快,很好
25 1.5.6. Fundamental theorem: Gallager’s proof . . . . . . . . . . . . . . . . 26 1.5.6.1. Upper bound of the probability of error. . . . . . . . . . . . . . . 27 1.5.6.2. Use of random coding . . ...
1.1 F’urpose of This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Introduction: Where Are Codes? . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 The Communications System ...
Derivatives of polynomials. Interpolation with Newton formula. Rootfinder algorithms: Jenkins-Traub, Durand-Kerner-Aberth, Newton Generalized, Laguerre, Siljak, Ruffini. Orthogonal polynomials. ...
Irreducibility of the Cyclotomic Polynomials Over Q 317 §6. Where Does It All Go? Or Rather, Where Does Some of It Go? ... . 321 CHAPTER IX The Real and Complex Numbers 326 §1. Ordering of ...
13623-calculate-roots-of-chebyshev-polynomials.zip.zip
Almost any cryptographic scheme can be ...when applied to random polynomials of degree d over n secret variables whenever the number m of public variables exceeds d + logdn. Their complexity is 2d
Characteristic Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Long Nonlinear Sequences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 ChipWaveforms...
关于多项式的Hadamard幂的一个猜想,王毅,张滨,设f(x)=∑ i=0^n aix^i是一个n次正系数多项式,它的p次Hadamard幂是多项式f^[p](x)=∑ i=0^n a i^px^i.一个长期没解决的猜想是:设p>1,若多项式f(x)仅�
12 Polynomials and Polynomial Functions . . . . . . . . . . . . . . . 133 13 Numerical Operations on Functions . . . . . . . . . . . . . . . . 136 14 Discrete Fourier Transform . . . . . . . . . . . ....
and how Brouncker's formula of 1655 can be derived from Euler's efforts in Special Functions and Orthogonal Polynomials. The most interesting applications of this work are discussed, including the ...
16.2Roots of Polynomials and Interpolation .................. 186 17 Formal Propositional Logic 191 17.1Syntactics: The Language of Formal Propositional Logic .. 193 17.2Semantics: Logical Algebras......
zernike polynomials.docx用于反射面天线优化
Hermite插值多项式拟合Matlab程序。运用Matlab软件依据理论可画出Hermite插值图像,并求出Hermite多项式,并应用到实际问题中。
Despite the increasing use of computers, the basic need for mathematical tables continues. Tables serve a vital role in preliminary surveys of problems before programming for machine operation, and ...
the Zernike polynomials are a sequence of polynomials that are orthogonal on the unit disk. Named after optical physicist Frits Zernike, winner of the 1953 Nobel Prize in Physics and the inventor of ...
连分式与A、B型错排多项式,刘丽,,本文,我们统一地给出了A、B型错排多项式的一般发生函数的连分式展开。我们的证明是基于它们的指数发生函数及指数Riordan阵理论。
多项式矩阵的最小多项式的快速算法,于波,徐艳艳,本文给出计算多项式矩阵的最小多项式的一个快速算法. 它由低到高逐项确定最小多项式的系数多项式. 通过采用随机向量和随机原点位�
建立两个链表为稀疏多项式,将他们每项按项相加,最后将得到的链表打印出来。