摘要: /*关键是迭代公式要收敛*/#include<stdio.h>#include<math.h>double f(double x,double Y){return 8*pow(x,4)-7*pow(x,3)+2*x*x+3*x+6-Y;}double f_(double x){return 32*pow(x,3)-21*x*x+4*x+3;}int main(){ int T;double x1,x2,Y;scanf("%d",&T);while(T--){ scanf("%lf",&Y); if(f(0,Y)&g 阅读全文
posted @ 2012-05-24 21:05 加拿大小哥哥 阅读(237) 评论(0) 推荐(0)
摘要: 解方程时间限制:1000 ms | 内存限制:65535 KB难度:3描述Now,given the equation 8*x^4 - 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky.输入 The first line of the input contains an integer T(1<=T<=100) which means the number of test cases. Then T lines follow, each 阅读全文
posted @ 2012-05-24 21:00 加拿大小哥哥 阅读(354) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<string.h>#define N 10001#define MAX(m,n) ((m)>(n)?(m):(n))char a[N],b[N];int d[N][N];int cmp(const void *a,const void *b){ return *(char *)a-*(char *)b;}int My_Cancel(int len)/*删除相邻的同样数据,不相邻的并不删除,即aabbab,输出abab不是ab,成为单调递增,否则成为单调不减序列**/{ int i,j=0; for(i=0;i&l 阅读全文
posted @ 2012-05-24 13:04 加拿大小哥哥 阅读(296) 评论(0) 推荐(1)
摘要: 1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 char str[10010]; 6 int ans[10010]; 7 8 int main() 9 {10 int i,j,k;11 int T;12 scanf("%d%*c",&T);13 while(T--)14 {15 memset(str,0,sizeof(str));16 memset(ans,0,sizeof(ans));17 18 scanf("%... 阅读全文
posted @ 2012-05-24 12:59 加拿大小哥哥 阅读(242) 评论(0) 推荐(0)