【POJ2094】【差分序列】Angry Teacher
Description
Recently Andrew failed to do his homework again, so he was given a
special task. If he doesn't do it, he will be expelled from his school.
The task seems very easy, but it is very technical, so it would take a
lot of time. Andrew is given a polynomial p(x) = anxn + an-1xn-1 + . . . + a1x + a0 with integer coefficients.
He must calculate the value of the polynomial for k successive
integer numbers starting from l. Of course writing all these numbers
would require too much paper. So as a proof of completing the task, for
each number x from l to l + k - 1 Andrew is asked to provide the sum of
squares of m last digits in decimal notation of p(x).
Since Andrew is lazy, he doesn't want to do the task by himself. So
he asks you to write the program that calculates the values requested.
Input
The following n + 1 lines contain coefficients of the polynomial: an , an-1 , . . . , a1 , a0 (0 <= ai <= 101000).
Output
Sample Input
3 0 10 2
1
0
2
1
Sample Output
1
16
10
25
58
45
85
89
85
80
Source
【POJ2094】【差分序列】Angry Teacher的更多相关文章
- poj2094
很不错的一道题,很让我见识到了差分序列的运用的神奇之处..一下是从北邮BBS看到的题解,写得很清楚..这边就直接转过来. uRLhttp://bbs.byr.cn/#!article/ACM_ICPC ...
- English trip V1 - 1.How Do You Feel Now? Teacher:Lamb Key:形容词(Adjectives)
In this lesson you will learn to describe people, things, and feelings.在本课中,您将学习如何描述人,事和感受. STARTER ...
- 设有一数据库,包括四个表:学生表(Student)、课程表(Course)、成绩表(Score)以及教师信息表(Teacher)。
一. 设有一数据库,包括四个表:学生表(Student).课程表(Course).成绩表(Score)以及教师信息表(Teacher).四个表的结构分别如表1-1的表(一)~表( ...
- 【英语学习】2016.09.11 Culture Insider: Teacher's Day in ancient China
Culture Insider: Teacher's Day in ancient China 2016-09-10 CHINADAILY Today is the 32nd Chinese Te ...
- poj 2515 差分序列,排列组合
大神博客链接 http://blog.csdn.net/kksleric/article/details/8021276 这道题的差分序列从没看过,公式题. 先构造从0到m的第p阶差分序列,算出0^p ...
- Don't make a promise when you are in Joy. Don't reply when you are Sad.Don't take decisions when you are Angry.Think Twice.Act Wise.
Don't make a promise when you are in Joy. Don't reply when you are Sad.Don't take decisions when you ...
- 对teacher表进行增加,删除,修改
<%@page import="java.text.SimpleDateFormat"%> <%@ page language="java" ...
- 超强语感训练文章(Provided by Rocky teacher Prince)
Content: Class1 My name is Prince Class2 Welcome to our hotel Class3 We’re not afraid of problems Cl ...
- hdu 5762 Teacher Bo 曼哈顿路径
Teacher Bo Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Tota ...
随机推荐
- 【Java基础】关于String的总结
String构造方法初始化和常量赋值初始化区别 下面的代码是一个String对象的两种不同的初始化方式,关于这两种不同初始化方式的区别,本文通过画内存图来进行解释,首先代码如下: public cla ...
- HW2.23
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- 从java程序员到CTO的成长路线图
很多新人不知道从事java开发,具体的发展路径是怎么样的,甚至很多人都不能区分程序猿和攻城师的区别.包括不少小白,从事java开发都半年,甚至1年了,对职业发展还没有清晰的认证.这非常不利于自己的发展 ...
- hdoj 2568 前进
前进 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submissi ...
- Yii2 多域名跨域同步登录退出
在平台开发过程中,项目分为前台(frontend)www.xxx.com和后台(backend) yun.xxx.com两部分,绑定两个域名, 我们知道在没有绑定域名的时候前后台可以同步登录和退出,但 ...
- mysqldump备份原理6
写在前面:我们在使用mysqldump备份数据时,请一定记住要加上 -q 参数,后果可能是很严重的,不要给自己挖坑哦.到底为什么呢,且听我慢慢道来! 先来看看 mysqldump –help 中,关于 ...
- careercup-树与图 4.5
4.5 实现一个函数,检查一棵二叉树是否为二叉查找树. 参考:http://blog.csdn.net/sgbfblog/article/details/7771096 C++实现代码: #inclu ...
- 标准I/O库之每次一行I/O
下面两个函数提供每次输入一行的功能. #include <stdio.h> char *fgets( char *restrict buf, int n, FILE *restrict f ...
- 如何运用管理员身份运行cmd窗口?
所有程序 → 附件 → 命令行提示符 → 鼠标右键“以管理员身份运行”.
- EasilyUI的一个简单的拖拽功能
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Main.aspx.cs&quo ...