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 ...
- iOS开发——实用篇Swift篇&QQ登入界面实现
QQ登入界面实现 我们知道在App Store中几乎所有软件都设计到账户的登入,而我们最常见的就是QQ,微信,在没有踏入程序员这条不归路之前,看到一个个的界面都感觉好高大上的样子. 在学习的过程中,自 ...
- ios开发——实用技术篇Swift篇&多点触摸与手势识别
多点触摸与手势识别 //点击事件 var atap = UITapGestureRecognizer(target: self, action: "tapDo:") self.vi ...
- 【Github教程】史上最全github用法:github入门到精通
原文 http://www.eoeandroid.com/thread-274556-1-1.html [初识Github] 首先让我们大家一起喊一句"Hello Github". ...
- mysql并发复制系列 一:binlog组提交
http://blog.itpub.net/28218939/viewspace-1975809/ 作者:沃趣科技MySQL数据库工程师 麻鹏飞 MySQL Binary log在MySQL 5. ...
- Linux 内核动态函数调用可视化工具
要求: python .7以上 https://www.python.org/ftp/python/ EG:wget --no-check-certificate https://www.python ...
- [带你飞]一小时带你学会Python
1.面向的读者: 具有Javascript经验的程序猿. 2 快速入门2.1 Hello world 安装完Python之后,打开IDLE(Python GUI) , 该程序是Python语言解释器, ...
- HTML 之 Web页面表单form中只有一个input的text元素,按回车默认提交
WEB开发中,如果页面的 form 中只有一个input元素,在该input元素的输入框中按回车(注:此时并没有写对应的onkeydown等事件处理),则浏览器会默认提交表单,请看如下代码: < ...
- Android(java)学习笔记83:finally关键字的作用
package cn.itcast_07; import java.text.ParseException; import java.text.SimpleDateFormat; import jav ...
- A simple way for hover pop bootstrap nav-menu
.navbar .nav > li .dropdown-menu { margin:; } .navbar .nav > li:hover .dropdown-menu { display ...