Poj 2583 Series Determination
来源:互联网 发布:淘宝steam激活码哪来的 编辑:程序博客网 时间:2024/05/21 06:18
1.Link:
http://poj.org/problem?id=2583
2.Content:
Series DeterminationTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6215 Accepted: 4090Description
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 01 1 11 2 30 1 40 2 8Sample Output
0 0 01 1 14 5 69 16 2518 32 50Source
South Central USA 2003
3.Method:
4.Code:
1 #include <iostream> 2 #include <cstdio> 3 4 using namespace std; 5 6 int main() 7 { 8 double x,y,z; 9 double a,b,c;10 double p,q,r;11 while(cin>>x>>y>>z)12 {13 a=(z-2*y+x)/2;14 b=2*y-3*x/2-z/2;15 c=x;16 //cout<<a<<" "<<b<<" "<<c<<endl;17 p=a*3*3+b*3+c;18 q=a*4*4+b*4+c;19 r=a*5*5+b*5+c;20 printf("%.0lf %.0lf %.0lf\n",p,q,r);21 }22 //system("pause");23 return 0;24 }
5.Reference:
0 0
- poj 2583 Series Determination
- Poj 2583 Series Determination
- poj 2583 水题 Series Determination
- POJ 2583 Series Determination G++
- Series Determination
- Series Determination
- fjnu 1707 Series Determination
- HOJ 2076 Series Determination
- poj Matrix Power Series
- Matrix Power Series POJ
- POJ 3233 Matrix Power Series
- POJ 3233Matrix Power Series
- poj 3233 Matrix Power Series
- poj 3233 Matrix Power Series
- Poj 3233 Matrix Power Series
- POJ 3233 Matrix Power Series
- [POJ]3233. Matrix Power Series
- poj 3233 Matrix Power Series
- java--String常量池问题的几个例子(转)
- LinkedList和ArrayList的区别 (转)
- Java序列化的机制和原理(转)
- 分享下今天研究的流量上限DDos攻击分析和解决方案
- Poj OpenJudge 1068 Parencodings
- Poj 2583 Series Determination
- Poj 2707 Copier Reduction
- Bitmap OOM问题解决及优化
- Poj 2840 Big Clock
- Poj 3030 Nasty Hacks
- Poj 3062 Celebrity jeopardy
- Poj 3117 World Cup
- Poj 3278 Catch That Cow
- Poj 3126 Prime Path