链接:click here
题意: 给出n,代表多项式有n+1项,要求多项式求导后每一项的系数,常数项就不用输出。
思路:(吐槽)题意一直没读懂~~ORZ~~英语阅读和理解能力要抓狂啊~~~,最后发现简单的模拟
代码:
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <algorithm>
using namespace std;
const int Inf=0x3f3f3f;
const int maxn=1000;
const double eps=1e-6;
const double pi=acos(-1.0);
int n,m,i,j;
int cost[maxn][maxn];
double vis[maxn];
int aa[maxn];
int main()
{
int n,m,i,j;
cin>>n;
while(n--)
{
cin>>m;
for(i=0; i<m+1; i++)
{
cin>>aa[i];
//cout<<m*(aa[i]-1)<<" ";
}
// if(m==0)
// cout<<0<<endl;
// else
// {
for(i=0; i<m; i++)
{
if(i!=0) cout<<" ";
cout<<aa[i]*(m-i);
// if (i<=mm-1)cout<<mm*aa[i]<<" ";
// else cout<<mm*aa[i];
// mm--;
}
cout<<(m==0?"0":"")<<endl;
//cout<<endl;;
}
return 0;
}
ZOJ 2969 && BNU16488 Easy Task
原文地址:http://blog.csdn.net/u013050857/article/details/43165953