- 浏览: 36700 次
- 性别:
- 来自: 杭州
最新评论
多项式乘法
Sample Input
2 1 2.4 0 3.2 2 2 1.5 1 0.5Sample Output
3 3 3.6 2 6.0 1 1.6
#include <string.h> #include <iostream> #include <iomanip> using namespace std; int main() { int K1,K2; int count = 0; float V1[1001] = {0}; float V2[1001] = {0}; float V3[2002] = {0}; map<int, float> MapX; cin>>K1; while(K1--) { int i; float x; cin>>i>>x; V1[i] = x; } cin>>K2; while(K2--) { int i; float x; cin>>i>>x; V2[i] = x; } for (int i = 0; i < 1001; i++) { for (int j = 0; j < 1001; j++) { V3[i+j] = V1[i]*V2[j] + V3[i+j]; } } for (int i = 2001; i >=0; i--) { if (V3[i] != 0) { count++; } } cout<<count; for (int i = 2001; i >=0; i--) { if (V3[i] != 0) { cout.setf(ios::fixed); cout<<" "<<i<<" "<<setprecision(1)<<V3[i]; } } return 0; }
发表评论
-
PAT1013 Battle Over Cities
2012-11-29 23:59 775Sample Input 3 2 3 1 2 1 3 ... -
PAT1003 Emergency
2012-11-29 23:46 664Sample Input 5 6 0 2 1 2 1 ... -
PAT1041 Be Unique
2012-11-23 23:43 762找出只出现过一次的数,用各种排序必然超时,需要用数组做hash ... -
PAT1042 Shuffling Machine
2012-11-23 23:42 735扑克洗牌 #include < ... -
PAT1040 Longest Symmetric String
2012-11-23 23:41 960求最长回文子串 #include < ... -
PAT1036 Boys vs Girls
2012-11-23 23:41 716Sample Input 1: 3 Joe M Mat ... -
PAT1035 Password
2012-11-23 23:40 618Sample Input 1: 3 Team0000 ... -
PAT1031 Hello World for U
2012-11-22 23:54 656Sample Input: helloworld! S ... -
PAT1029 Median
2012-11-22 23:54 655用标准库的排序全部超时,需要自己实现,另外还不能用cin co ... -
PAT1028 List Sorting
2012-11-22 23:53 810用vector最后一个用例超时了。。。 Sample ... -
PAT1027 Colors in Mars
2012-11-22 23:52 625Sample Input 15 43 71 Samp ... -
PAT1025 PAT Ranking
2012-11-22 23:51 774Sample Input: 2 5 123456789 ... -
PAT1023 Have Fun with Numbers
2012-11-21 23:55 688大数的相加 比较两个字符串中字符完全相同 Sa ... -
PAT1020 Tree Traversals
2012-11-21 23:54 654已知中序遍历 后序遍历,求层次遍历 Sample In ... -
PAT1019 General Palindromic Number
2012-11-21 23:53 539十进制转任意进制,并比较是否是回文数 Sample I ... -
PAT1037 Magic Coupon
2012-11-21 15:46 664Sample Input: 4 1 2 4 -1 ... -
PAT1038 Recover the Smallest Number
2012-11-20 23:52 1670由一道面试题改的 把数组排成最小的数 不同之处是这 ... -
PAT1024 Palindromic Number
2012-11-20 23:51 650Sample Input 1: 67 3 Sampl ... -
PAT1015 Reversible Primes
2012-11-19 23:51 771十进制转任意进制 假设十进制数为number,转 ... -
PAT1012 The Best Rank
2012-11-19 23:50 927四门功课,输出排名最高的是哪个 Sample Inpu ...
相关推荐
Computing Roots of Polynomials ,采用数值方法求根,速度快,很好
This book tells how Euler introduced the idea of orthogonal polynomials and combined the two subjects, and how Brouncker's formula of 1655 can be derived from Euler's efforts in Special Functions and...
关于多项式的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)仅�
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
This book tells how Euler introduced the idea of orthogonal polynomials and combined the two subjects, and how Brouncker's formula of 1655 can be derived from Euler's efforts in Special Functions and...
割圆多项式的正规分解,武跟强,李研超,本文首先研究整数q模整数m的阶,接着研究了m次割圆多项式在域K上的分解。通过对整数m的素数幂分解,我们对q模m的阶进行了深入的研�
多项式矩阵的最小多项式的快速算法,于波,徐艳艳,本文给出计算多项式矩阵的最小多项式的一个快速算法. 它由低到高逐项确定最小多项式的系数多项式. 通过采用随机向量和随机原点位�
Multi-Client Verifiable Computation Service of Polynomials on Outsourced Data
B型和D型极大抛物型Kazhdan-Lusztig R-多项式,范久瑜,,在本文中,我们给出了某些$B$型和$D$型极大抛物型Kazhdan-Lusztig $R$-多项式的显式表达式。记$B_n$为$B$型Coxeter群,生成元集记为$S_n^B={s_0,s_1,ldot
连分式与A、B型错排多项式,刘丽,,本文,我们统一地给出了A、B型错排多项式的一般发生函数的连分式展开。我们的证明是基于它们的指数发生函数及指数Riordan阵理论。
13623-calculate-roots-of-chebyshev-polynomials.zip.zip
Verifiable Computation of Large Polynomials
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 ...
完全置换多项式的一些新构造,马景学,张韬,本文给出一些新的完全置换多项式的构造,包括四类单项式和一类三项式。此外,我们给出两类新的三项置换多项式,其中第一类证明了此前
参考资料:参见 K Vasudevan 所著“数字通信和信号处理”一书中的附录 C
建立两个链表为稀疏多项式,将他们每项按项相加,最后将得到的链表打印出来。
Coxeter群上Eulerian多项式的强$q$-对数凸性,刘丽,祝宝宣,本文借助指数发生函数,得到了Coxeter群上Eulerian多项式的强$q$-对数凸性,其证明方法基于指数Riordan矩阵和证明多项式序列具有强$q$-对数凸�
在有限域上快速构建不可约多项式的方法。虽说是全英文介绍,但是只需要了解其中大概即可。文档介绍了构建基础知识,值得有需要的朋友阅读借鉴。
一种计算$GF(2)$上指数为梅森素数的不可约多项式的方法,王剑涛,郑东,本文描述了模$2^n-1$的剩余的群结构。当$2^n-1$为素数时,该群为循环群。元素$ lpha$的迹的计算可由此群的结构进行化简。利用迹函数的置��
多项式相加 数学上使用行列式来解决 可以使用克拉默法则来写