【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 ...
随机推荐
- POJ1050:To the max
poj1050:http://poj.org/problem?id=1050 * maximum-subarray 问题的升级版本~ 本题同样是采用DP思想来做,同时有个小技巧处理:就是把二维数组看做 ...
- Hadoop build error java.lang.NoClassDefFoundError: org/sonatype/aether/graph/DependencyFilter
When running the command: + mvn site site:stage -DskipTests -DskipTest -DskipITs you get an error: ...
- JS/JQ综合总结
总结 js部分 一 语法结构 1 区分大小写 2注意 //单行 /*多行注释*/ 3子面量(直接量 literal) 12//数字 5.8//小数 "hello"字符串 true ...
- Mac下eclipse安装SVN插件
eclipse中最常使用的SVN插件是subclipse,先到subclipse官网:http://subclipse.tigris.org下载该插件. 如上图,点击“Download and I ...
- Ubuntu 14.10安装SecureCRT 7.3
Ubuntu 14.10下安装SecureCRT 7.3 1.软件准备 Ubuntu14.10 x64 SecureCRT7.3的版本:scrt-7.3.0-657.ubuntu13-64.x86_6 ...
- Recommended add-ons/plugins for Microsoft Visual Studio
http://stackoverflow.com/questions/2767/recommended-add-ons-plugins-for-microsoft-visual-studio NUGe ...
- qt学习笔记(五) QGraphicsPixmapItem与QGraphicsScene的编程实例 图标拖动渐变效果
应大家的要求,还是把完整的project文件贴出来,大家省点事:http://www.kuaipan.cn/file/id_48923272389086450.htm 先看看执行效果,我用的群创7寸屏 ...
- android104 帧动画,补间动画,属性动画
##帧动画FrameAnimation* 多张图片快速切换,形成动画效果* 帧动画使用xml定义 package com.itheima.frameanimation; import android. ...
- Linux内存管理学习笔记--物理内存分配
http://blog.chinaunix.net/uid-20321537-id-3466022.html
- 数据持久层(三)ODB介绍
ODB: C++ Object-Relational Mapping (ORM) ODB is an open-source, cross-platform, and cross-database o ...