Poj 2583 Series Determination
1.Link:
http://poj.org/problem?id=2583
2.Content:
Series Determination
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6215 Accepted: 4090 Description
Boudreaux and Thibodeaux aren't very good at math, so they need you to write a program that can determine the second degree polynomial used to generate a given sequence of three integers. As proof that you've figured out the polynomial, they want your program to print out the next 3 integers in the sequence.You know that each sequence is generated by a polynomial of the form f(x) = Ax2 + Bx + C, where A, B, and C are integers in the range (-103 <= (A, B, C) <= 103). You are given the values f(0), f(1), f(2) and are to determine the values f(3), f(4), f(5).
Input
Input to this problem will consist of a (non-empty) series of up to 100 data sets. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets.Each data set consists of a single line containing the space-separated integer values of the polynomial evaluated at 0, 1, and 2 (in that order). These values will be in the range (-103 <= (f(0), f(1), f(2)) <= 103).
Output
For each data set, there will be exactly one line of output containing the space-separated integer values of the polynomial evaluated at 3, 4, and 5 (in that order). These values will be in the range (-104 <= (f(3), f(4), f(5)) <= 104).Sample Input
0 0 0
1 1 1
1 2 3
0 1 4
0 2 8Sample Output
0 0 0
1 1 1
4 5 6
9 16 25
18 32 50Source
3.Method:
4.Code:
#include <iostream>
#include <cstdio> using namespace std; int main()
{
double x,y,z;
double a,b,c;
double p,q,r;
while(cin>>x>>y>>z)
{
a=(z-*y+x)/;
b=*y-*x/-z/;
c=x;
//cout<<a<<" "<<b<<" "<<c<<endl;
p=a**+b*+c;
q=a**+b*+c;
r=a**+b*+c;
printf("%.0lf %.0lf %.0lf\n",p,q,r);
}
//system("pause");
return ;
}
5.Reference:
Poj 2583 Series Determination的更多相关文章
- POJ 2583
#include<iostream> #include<stdio.h> using namespace std; int main() { //freopen("a ...
- HOJ题目分类
各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...
- POJ 3233Matrix Power Series
妈妈呀....这简直是目前死得最惨的一次. 贴题目: http://poj.org/problem?id=3233 Matrix Power Series Time Limit: 3000MS Mem ...
- POJ 3233 Matrix Power Series (矩阵乘法)
Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 11954 Accepted: ...
- POJ 3233 Matrix Power Series 【经典矩阵快速幂+二分】
任意门:http://poj.org/problem?id=3233 Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K To ...
- [ACM] POJ 3233 Matrix Power Series (求矩阵A+A^2+A^3...+A^k,二分求和或者矩阵转化)
Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 15417 Accepted: ...
- 矩阵十点【两】 poj 1575 Tr A poj 3233 Matrix Power Series
poj 1575 Tr A 主题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1575 题目大意:A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的 ...
- Poj 3233 Matrix Power Series(矩阵乘法)
Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Description Given a n × n matrix A and ...
- POJ 3233-Matrix Power Series( S = A + A^2 + A^3 + … + A^k 矩阵快速幂取模)
Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 20309 Accepted: ...
随机推荐
- [MODX] 2. Chunks $
Chunk in Modx can cut your template into samll pieces to make code reuseable. [[$chunk_name]] For ex ...
- [MEAN Stack] First API -- 6. Using Express route instance
For server.js, we update the code by using route instance. By using this, we can remove some duplica ...
- vs2012调试时为什么会出现clr.dll与mscordacwks.dll版本不匹配
第一次开发wpf程序,就遇到了上述问题,最后发现是因为vs2012默认用的是.net4.5,将版本改为.net4就好了,问题解决
- Implementing the skip list data structure in java --reference
reference:http://www.mathcs.emory.edu/~cheung/Courses/323/Syllabus/Map/skip-list-impl.html The link ...
- rabbitmq——用户管理
安装最新版本的rabbitmq(3.3.1),并启用management plugin后,使用默认的账号guest登陆管理控制台,却提示登陆失败. 翻看官方的release文档后,得知由于账号gues ...
- Python 计算程序运行时间
import time def start_sleep(): time.sleep(3) if __name__ == '__main__': #The start time st ...
- 1002 GTY's birthday gift
GTY's birthday gift Time Limit ...
- ArcEngine中打开各种数据源(WorkSpace)的连接http://www.cnblogs.com/feilong3540717/archive/2011/08/07/2129906.html
ArcEngine中打开各种数据源(WorkSpace)的连接 ArcEngine中打开各种数据源(WorkSpace)的连接 (SDE.personal/File.ShapeFile.CAD数据.影 ...
- C#获取CPU等硬件ID(转载)
System.Management命名空间提供对大量管理信息和管理事件集合的访问,这些信息和事件是与根据 Windows 管理规范 (WMI) 结构对系统.设备和应用程序设置检测点有关的.应用程序和服 ...
- 模拟游客一天的生活与旅游java程序代写源码
在某个城市的商业区里,有一家首饰店,一家饭店,一家面馆,一家火锅店,一家银行,一家当铺 现在有一群来自四川的游客,一群陕西的游客,一群上海的游客,和以上各店家的工作人员在此区域里,请模拟他们一天的生活 ...