ZOJ 2969 && BNU16488 Easy Task

链接: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;
}
时间: 2024-10-17 12:10:18

ZOJ 2969 && BNU16488 Easy Task的相关文章

哈理工2015暑假训练赛BNU16488 Easy Task(简单题)

A - Easy Task Time Limit:2000MS    Memory Limit:65536KB    64bit IO Format:%lld & %llu SubmitStatusPracticeZOJ 2969 Description Calculating the derivation of a polynomial is an easy task. Given a function f(x) , we use (f(x))' to denote its derivatio

【ZOJ 3844】Easy Task

题意 每次把序列中最大的数a的一个和最小的数b的一个变成a-b.求最后是否能使序列里的数全部相同,能则输出这个相同的数. 分析 一定是有解的,证明想不出来. 可以直接暴力模拟. 代码 #include<cstdio> int ok(int a[],int n) { int i; for(i=1; i<n; i++) if(a[i]!=a[i+1])break; return i==n; } int main() { int t; scanf("%d",&t);

ZOJ 2969: Easy Task

ZOJ 2969: Easy Task 1 ///@date 2017-02-07 2 ///@author Sycamore, ZJNU 3 #include <iostream> 4 using namespace std; 5 int c[1001]; 6 int main() 7 { 8 int T; 9 cin >> T; 10 while (T--) 11 { 12 int N; 13 cin >> N; 14 for (int i = N; i >=

[ACM] ZOJ 3844 Easy Task (模拟+哈希)

Easy Task Time Limit: 2 Seconds      Memory Limit: 65536 KB You are given n integers. Your task is very easy. You should find the maximum integer a and the minimum integer b among these n integers. And then you should replace both a and bwith a-b. Yo

HDU-1076-An Easy Task(Debian下水题测试.....)

An Easy Task Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 17062    Accepted Submission(s): 10902 Problem Description Ignatius was born in a leap year, so he want to know when he could hold h

杭电OJ(HDU)-ACMSteps-Chapter Two-《An Easy Task》《Buildings》《decimal system》《Vowel Counting》

http://acm.hdu.edu.cn/game/entry/problem/list.php?chapterid=1§ionid=2 1.2.5 #include<stdio.h> /* 题意:找闰年. if((i%4==0 && i%100!=0) || i%400==0)count++; 3 2005 25 1855 12 2004 10000 2108 1904 43236 */ int main() { int t,y,n; int i,count=0; whil

zoj 3791 An Easy Game dp

An Easy Game Time Limit: 2 Seconds      Memory Limit: 65536 KB One day, Edward and Flandre play a game. Flandre will show two 01-strings s1 and s2, the lengths of two strings are n. Then, Edward must move exact k steps. In each step, Edward should ch

HDU-------An Easy Task

An Easy Task Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4088 Accepted Submission(s): 2327   Problem Description Ignatius was born in a leap year, so he want to know when he could hold his bir

2016 省热身赛 Easy Task

Easy Task Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Description You are given n integers. Your task is very easy. You should find the maximum integer a and the minimum integer b among these nintegers. And then you sho