【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 ...
随机推荐
- 高效Linux用户需要了解的命令行技能
最近在Quora上看到一个问答题目,关于在高效率Linux用户节省时间Tips. 将该题目的回答进行学习总结,加上自己的一些经验,记录如下,方便自己和大家参考. 下面介绍的都是一些命令行工具,这些工具 ...
- 多组radio传值注意事项
多组radio传值,每组的radio name必须不同,否则所有的radio将被视为一组,传值时只会传其中一组的值到后台,如果这时你用数组接收从前台传过来的值并使用,就会报数组越界异常
- Step2:配置Oracle Dataguard
接着step1我用Rman duplicate测试下. 1,2两步请参考step1中的1,2 3.startup nomount (standby),一定要是nomount. 4.rman dupli ...
- Asp.net Mvc 自定义Session (一),
大家都知道用系统默认的session 会存在这样的问题 如果用户过多的话 session 会自动消亡,而且不能支持分布式和集群. 这系列博客主要讲解 怎样 解决用户过多的session自动消亡,和分 ...
- Quartz 定时器时间设置
spring定时器的时间设置 时间的配置如下:<value>0 26 16 * * ?</value> 时间大小由小到大排列,从秒开始,顺序为 秒,分,时,天,月,年 ...
- jpcap 配置方法,问题解决,模拟sniffer程序。(附JAVA程序,jar,dll包等环境)
博文链接 http://www.cnblogs.com/xckk/p/4609444.html 一. Eclipse环境下安装与配置Jpcap 相关源程序.jpcap jar包,dll包,帮助文档 ...
- JavaScript的递归之更多例子
更多例子 第二个递归的例子是求两个自然数的最大公约数(有没有回到令人怀念的中学时代).下面的程序用的是经典的辗转相除法. //greatest common divisor //假定a.b都是正整数 ...
- js、jQuery操作input大全 不断完善
工作中经常用到的,不断更新中... jquery获取单选按钮的值:$("input[name='stageName']:checked").val(); 删除select某几个op ...
- jqgrid表格列动态加载的实现
选中几个测点名,在表格中就显示几列. 具体代码如下: function reloadGrid(postData){ $('#gridTable').jqGrid('GridUnload'); var ...
- Android中获取正在运行的应用程序-----ActivityManager.RunningAppProcessInfo类详解
今天继续讲解关于ActivityManager的使用,通过前面一节的学习,我们学会了如何利用ActivityManager获取系统里 正在运行的进程.本文要讲解的知识点是利用这些进程信息获取系统里正在 ...