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 8

Sample Output

0 0 0
1 1 1
4 5 6
9 16 25
18 32 50

Source

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的更多相关文章

  1. POJ 2583

    #include<iostream> #include<stdio.h> using namespace std; int main() { //freopen("a ...

  2. HOJ题目分类

    各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...

  3. POJ 3233Matrix Power Series

    妈妈呀....这简直是目前死得最惨的一次. 贴题目: http://poj.org/problem?id=3233 Matrix Power Series Time Limit: 3000MS Mem ...

  4. POJ 3233 Matrix Power Series (矩阵乘法)

    Matrix Power Series Time Limit: 3000MS   Memory Limit: 131072K Total Submissions: 11954   Accepted:  ...

  5. POJ 3233 Matrix Power Series 【经典矩阵快速幂+二分】

    任意门:http://poj.org/problem?id=3233 Matrix Power Series Time Limit: 3000MS   Memory Limit: 131072K To ...

  6. [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:  ...

  7. 矩阵十点【两】 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的迹(就是主对角线上各项的 ...

  8. Poj 3233 Matrix Power Series(矩阵乘法)

    Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Description Given a n × n matrix A and ...

  9. 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:  ...

随机推荐

  1. android圆角View实现及不同版本这间的兼容(android3.0过后的版本)

    http://blog.csdn.net/lovecluo/article/details/8710174 在做我们自己的APP的时候,为了让APP看起来更加的好看,我们就需要将我们的自己的View做 ...

  2. 统计0到n之间1的个数

    问题描写叙述 给定一个十进制整数N,求出从1到N的全部整数中出现"1"的个数. 比如:N=2时 1,2出现了1个 "1" . N=12时 1,2,3,4,5,6 ...

  3. SSO-Javascript模拟IE登录,不让IIS弹出登录窗口

    解决方案:         用JS模拟IE用户登录,再跳转到对应的系统.   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transiti ...

  4. 1020. Tree Traversals (25)

    the problem is from pat,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1020 and the ...

  5. centos6安装redis

    1.检查安装依赖程序 yum install gcc-c++ yum install -y tcl yum install wget 2.获取安装文件 wget http://download.red ...

  6. PHP.4-DIV+CSS标准网页布局准备工作(下)

    DIV+CSS标准网页布局准备工作 区块属性(区块模型) 属 性 描 述 Margin(注) 是定义区块外边界与上级元素距离的属性,用1到4个值来设置元素的边界,每个值都是长度.百分比或者auto,百 ...

  7. 小白日记9:kali渗透测试之主动信息收集(二)四层发现:TCP、UDP、nmap、hping、scapy

    四层发现 四层发现的目的是扫描出可能存活的IP地址,四层发现虽然涉及端口扫描,但是并不对端口的状态进行精确判断,其本质是利用四层协议的一些通信来识别主机ip是否存在. 四层发现的优点: 1.可路由且结 ...

  8. [置顶] 《MFC游戏开发》笔记一 系列简介

    本系列文章由七十一雾央编写,转载请注明出处.  http://blog.csdn.net/u011371356/article/details/9299121 作者:七十一雾央 新浪微博:http:/ ...

  9. Extjs之success、failure

    Ext.form.Action.Submit的配置选项success.failure是根据返回json中success属性判断的,如果success为true,则success,false则failu ...

  10. 【Irrlicht鬼火引擎】 安装配置Irrlicht鬼火引擎

    一.下载引擎 官方网站:http://irrlicht.sourceforge.net/‎ 官方网站需要FQ才能进入,如果不想FQ,可以通过其他下载地址:CSDN下载:http://download. ...