摘要: 顶点式 Y=a(X-h)^2+kcout#include #include using namespace std;struct Point{ double x; double y;};double fx(double a,double h,double k,double x){ return ((1./3)*a*x*x*x-h*a*x*x+(a*h*h+k)*x);}int m... 阅读全文
posted @ 2013-03-13 03:57 码代码的猿猿 阅读(136) 评论(0) 推荐(0)
摘要: #include using namespace std;int main(){int m;cin>>m;for(int j=0;j>x>>y; double r=x*x+y*y; area=3.1415926*r*.5; int n=static_cast((area/50)+0.9999999); cout<<"Property "<<j+1<<": This prop... 阅读全文
posted @ 2013-03-12 05:47 码代码的猿猿 阅读(114) 评论(0) 推荐(0)
摘要: 素数环,DFS能算到14就差不多了。。#include #include using namespace std;int is_prime(int n){ int ok=1; if(n==1||n==0) return 0; if(n==2) return 1; int m=sqrt(n)+1; for(int i=2;i>n){ int vis[30]={0... 阅读全文
posted @ 2013-03-09 05:28 码代码的猿猿 阅读(151) 评论(0) 推荐(0)
摘要: 超简单的回溯题,但两个月前我都不敢直视,今天又突然想起来,十分钟就搞定了。。。#include using namespace std;static int tot=0;void search_q(int cur,int* p,int n){ int i,j; if(cur==n) { tot++; cout<<tot<<":"; for... 阅读全文
posted @ 2013-03-08 19:18 码代码的猿猿 阅读(137) 评论(0) 推荐(0)
摘要: 看:http://www.cnblogs.com/abatei/archive/2008/11/17/1335031.html 阅读全文
posted @ 2013-03-08 01:20 码代码的猿猿 阅读(89) 评论(0) 推荐(0)
摘要: //小心格式问题#include #include #include using namespace std;int str[100010];int main(){ int step,mod;while(cin>>step>>mod){ memset(str,10010,sizeof(str)); str[0]=1; int seed=0; for(int i=0;i... 阅读全文
posted @ 2013-03-07 06:55 码代码的猿猿 阅读(94) 评论(0) 推荐(0)
摘要: #include #include using namespace std;int main(){ string str; int n; cin>>str; while(str!="0") { n=0; for(int i=0;i=10) { n=sum; s... 阅读全文
posted @ 2013-03-07 05:58 码代码的猿猿 阅读(90) 评论(0) 推荐(0)
摘要: #include #include using namespace std;int xxx(int i){ int xx=1; while(i>0) { xx*=i; i--; } return xx;}int main(){ cout<<"n e"<<endl; cout<<"- -----------"<<endl; ... 阅读全文
posted @ 2013-03-07 05:22 码代码的猿猿 阅读(98) 评论(0) 推荐(0)
摘要: 贪心问题,但要注意一些特殊数据:尤其是M=0,与F==0时的情况。0 11 01.0001 00.0005 410000 52000 2100 0300 010400.000数据类型用double,就这样#include #include #include using namespace std;struct jf{ double a; double b; double c;}J... 阅读全文
posted @ 2013-03-05 06:48 码代码的猿猿 阅读(195) 评论(0) 推荐(0)
摘要: 就是求平面上N点间的最短距离,但是没过;老是Compilation Error,但其实是可以运行的啊人挫没办法!以下是代码:#include #include #include #include #define MM 100020using namespace std;struct Note{ double x; double y;}pt[MM];int _sort1[MM];int ... 阅读全文
posted @ 2013-03-04 01:27 码代码的猿猿 阅读(153) 评论(0) 推荐(0)